DEV: Fix flaky system test (#26479)

Why this change?

`expect(page.title).to starts_with("...")` does not rely on capybara
waiters. This commit switches us to use `have_title` instead which will
rely on Capybara waiters.
This commit is contained in:
Alan Guo Xiang Tan 2024-04-03 10:04:48 +08:00 committed by GitHub
parent 9c9374f060
commit 477a67e4fb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -17,7 +17,7 @@ RSpec.describe "Document title", type: :system do
it "shows the channel name in the document title" do
chat_page.visit_channel(channel_1)
expect(page.title).to start_with("##{channel_1.title}")
expect(page).to have_title("##{channel_1.title}")
end
end
@ -33,7 +33,7 @@ RSpec.describe "Document title", type: :system do
it "shows the channel name in the document title" do
chat_page.visit_channel(channel_1)
expect(page.title).to start_with("#{channel_1.title(current_user)}")
expect(page).to have_title("#{channel_1.title(current_user)}")
end
end
end