mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Negative limit values shouldn't cause error 500 (#10162)
This commit is contained in:
@@ -707,6 +707,13 @@ describe TagsController do
|
||||
['common1', 'common2', 'group1tag', 'group1tag2']
|
||||
)
|
||||
end
|
||||
|
||||
it 'returns error 400 for negative limit' do
|
||||
get "/tags/filter/search.json", params: { q: '', limit: -1 }
|
||||
|
||||
expect(response.status).to eq(400)
|
||||
expect(response.parsed_body['errors'].first).to eq(I18n.t('invalid_params', message: 'limit'))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user