mirror of
https://github.com/discourse/discourse.git
synced 2025-01-06 13:39:54 +08:00
DEV: ensures channel has been created (#30445)
We were sometimes trying to fetch the channel before it has been created.
This commit is contained in:
parent
ae4a4b7d00
commit
3198326cda
|
@ -273,12 +273,14 @@ RSpec.describe "Create channel", type: :system do
|
||||||
chat_page.visit_browse
|
chat_page.visit_browse
|
||||||
chat_page.new_channel_button.click
|
chat_page.new_channel_button.click
|
||||||
channel_modal.select_category(category_1)
|
channel_modal.select_category(category_1)
|
||||||
|
|
||||||
expect(channel_modal).to have_name_prefilled(category_1.name)
|
expect(channel_modal).to have_name_prefilled(category_1.name)
|
||||||
|
|
||||||
channel_modal.fill_description("All kind of cute cats")
|
channel_modal.fill_description("All kind of cute cats")
|
||||||
channel_modal.click_primary_button
|
channel_modal.click_primary_button
|
||||||
|
|
||||||
expect(page).to have_content(category_1.name)
|
expect(channel_modal).to be_closed
|
||||||
|
|
||||||
created_channel = Chat::Channel.find_by(chatable_id: category_1.id)
|
created_channel = Chat::Channel.find_by(chatable_id: category_1.id)
|
||||||
expect(page).to have_current_path(
|
expect(page).to have_current_path(
|
||||||
chat.channel_path(created_channel.slug, created_channel.id),
|
chat.channel_path(created_channel.slug, created_channel.id),
|
||||||
|
|
|
@ -39,6 +39,10 @@ module PageObjects
|
||||||
def has_name_prefilled?(name)
|
def has_name_prefilled?(name)
|
||||||
has_field?("name", with: name)
|
has_field?("name", with: name)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def closed?
|
||||||
|
has_no_selector?(".chat-modal-create-channel")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user