DEV - Test for an integer padded with spaces (#11111)

This commit is contained in:
jbrw 2020-11-04 11:05:31 -05:00 committed by GitHub
parent 24d1b1f159
commit d85fc96193
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -345,6 +345,11 @@ describe SearchController do
expect(response.status).to eq(400)
end
it "returns a 400 error if the page parameter is padded with spaces" do
get "/search.json", params: { q: 'kittens', page: ' 3 ' }
expect(response.status).to eq(400)
end
it "logs the search term" do
SiteSetting.log_search_queries = true
get "/search.json", params: { q: 'bantha' }