FIX: keep the post_number parameter when redirecting to proper slug

This commit is contained in:
Régis Hanol
2014-08-13 22:12:44 +02:00
parent 9b4c18baf1
commit 6201b82a67
2 changed files with 13 additions and 4 deletions

View File

@ -558,6 +558,11 @@ describe TopicsController do
expect(response).to redirect_to(topic.relative_url)
end
it 'keeps the post_number parameter around when redirecting' do
xhr :get, :show, id: topic.slug, post_number: 42
expect(response).to redirect_to(topic.relative_url + "/42")
end
it 'returns 404 when an invalid slug is given and no id' do
xhr :get, :show, id: 'nope-nope'
expect(response.status).to eq(404)