FIX: raises an error if q param is empty in search page

This commit is contained in:
Vinoth Kannan
2018-12-20 21:43:14 +05:30
parent 400eea4d13
commit e7e4074856
2 changed files with 7 additions and 2 deletions

View File

@@ -127,6 +127,11 @@ describe SearchController do
end
context "#show" do
it "doesn't raise an error when search term not specified" do
get "/search"
expect(response.status).to eq(200)
end
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)