FIX: redirect to parent tag when synonym page visited (#31688)

When a synonym page is visited, the user should be redirected to the
parent tag.
This commit is contained in:
Krzysztof Kotlarek
2025-03-10 09:45:38 +11:00
committed by GitHub
parent 2237a0b0d5
commit 7da4fe82b6
2 changed files with 15 additions and 2 deletions

View File

@ -427,8 +427,9 @@ RSpec.describe TagsController do
it "should handle synonyms" do
synonym = Fabricate(:tag, target_tag: tag)
get "/tag/#{synonym.name}"
expect(response.status).to eq(200)
get "/tag/#{synonym.name}/l/top.json?period=daily"
expect(response.status).to eq(302)
expect(response.redirect_url).to match(%r{/tag/#{tag.name}/l/top.json\?period=daily})
end
it "does not show staff-only tags" do