diff --git a/spec/requests/search_controller_spec.rb b/spec/requests/search_controller_spec.rb index 0988c061179..5d7181f7a86 100644 --- a/spec/requests/search_controller_spec.rb +++ b/spec/requests/search_controller_spec.rb @@ -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' }