A platform for community discussion. Free, open, simple.
DEV: Update topic referer spec (#40905)
David Taylorc464c676a5ec
diff --git a/spec/requests/topics_controller_spec.rb b/spec/requests/topics_controller_spec.rbindex fafb48647d7..30ece7fd033 100644--- a/spec/requests/topics_controller_spec.rb+++ b/spec/requests/topics_controller_spec.rb@@ -3844,9 +3844,10 @@ RSpec.describe TopicsController doendend- it "records redirects" do+ it "records the referer for a visit arriving via redirect" doget "/t/#{topic.id}", headers: { HTTP_REFERER: "http://twitter.com" }- get "/t/#{topic.slug}/#{topic.id}", headers: { HTTP_REFERER: nil }+ # Simulate browsers, which preserve Referer across same-origin redirects+ follow_redirect!(headers: { "HTTP_REFERER" => "http://twitter.com" })link = IncomingLink.firstexpect(link.referer).to eq("http://twitter.com")