Skip to content

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

DEV: Avoid unnecessary redirect in system tests when visiting a topic (#32418)

Alan Guo Xiang Tance76d7aaa75d
diff --git a/spec/system/page_objects/pages/topic.rb b/spec/system/page_objects/pages/topic.rb
index 8ad3d415c71..cb95cb03dcd 100644
--- a/spec/system/page_objects/pages/topic.rb
+++ b/spec/system/page_objects/pages/topic.rb
@@ -11,9 +11,7 @@ module PageObjects
end
def visit_topic(topic, post_number: nil)
- url = "/t/#{topic.id}"
- url += "/#{post_number}" if post_number
- page.visit(url)
+ page.visit(topic.url(post_number))
self
end