From d85fc9619398b3558184b8ead2756472548791fd Mon Sep 17 00:00:00 2001 From: jbrw Date: Wed, 4 Nov 2020 11:05:31 -0500 Subject: [PATCH] DEV - Test for an integer padded with spaces (#11111) --- spec/requests/search_controller_spec.rb | 5 +++++ 1 file changed, 5 insertions(+) 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' }