mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FIX: Default to first page when page params is an array.
This commit is contained in:
@ -563,6 +563,11 @@ describe TopicsController do
|
||||
expect(response).to redirect_to(topic.relative_url + "/42?page=123")
|
||||
end
|
||||
|
||||
it 'does not accept page params as an array' do
|
||||
xhr :get, :show, id: topic.slug, post_number: 42, page: [2]
|
||||
expect(response).to redirect_to("#{topic.relative_url}/42?page=1")
|
||||
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)
|
||||
|
Reference in New Issue
Block a user