Skip to content

A platform for community discussion. Free, open, simple.

DEV: Fix about/topic page specs flakes (#40577)

Jarek Radosz3d249b3c1afc
diff --git a/spec/system/about_page_spec.rb b/spec/system/about_page_spec.rb
index c5c4f512fb5..6a3cf3743b7 100644
--- a/spec/system/about_page_spec.rb
+++ b/spec/system/about_page_spec.rb
@@ -455,7 +455,7 @@ describe "About page" do
about_page.edit_link.click
- expect(current_url).to end_with("/admin/config/about")
+ expect(page).to have_current_path("/admin/config/about")
end
it "doesn't appear for moderators" do
diff --git a/spec/system/topic_page_spec.rb b/spec/system/topic_page_spec.rb
index 4b43a9ec11c..73822fa9334 100644
--- a/spec/system/topic_page_spec.rb
+++ b/spec/system/topic_page_spec.rb
@@ -17,7 +17,7 @@ describe "Topic page" do
find("#toc-h2-testing .anchor", visible: :all).click
- expect(current_url).to match("/t/#{topic.slug}/#{topic.id}#toc-h2-testing")
+ expect(page).to have_current_path(%r{/t/#{topic.slug}/#{topic.id}#toc-h2-testing}, url: true)
end
context "with a subfolder setup" do
@@ -28,7 +28,10 @@ describe "Topic page" do
find("#toc-h2-testing .anchor", visible: :all).click
- expect(current_url).to match("/forum/t/#{topic.slug}/#{topic.id}#toc-h2-testing")
+ expect(page).to have_current_path(
+ %r{/forum/t/#{topic.slug}/#{topic.id}#toc-h2-testing},
+ url: true,
+ )
end
end