DEV: raise error if search term length is less than required

This commit is contained in:
Vinoth Kannan
2018-12-18 20:06:59 +05:30
parent 341a6bd78a
commit a313b01148
2 changed files with 8 additions and 1 deletions
+5
View File
@@ -127,6 +127,11 @@ describe SearchController do
end
context "#show" do
it "raises an error when the search term length is less than required" do
get "/search.json", params: { q: 'ba' }
expect(response.status).to eq(400)
end
it "logs the search term" do
SiteSetting.log_search_queries = true
get "/search.json", params: { q: 'bantha' }