FIX: Negative limit values shouldn't cause error 500 (#10162)

This commit is contained in:
Osama Sayegh
2020-07-02 19:52:37 +03:00
committed by GitHub
parent 2df388ffd7
commit de243426c4
2 changed files with 11 additions and 0 deletions

View File

@@ -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