application controller: fix errors in normalize_search.

Fix exceptions in `normalize_search` on e.g. `https://danbooru.donmai.us/users?search=blah`.
Caused when the `search` param is not a hash.
This commit is contained in:
evazion
2019-08-13 21:30:20 -05:00
parent d7fce22ee5
commit 28a88cfa85
2 changed files with 10 additions and 3 deletions

View File

@@ -35,5 +35,10 @@ class ApplicationControllerTest < ActionDispatch::IntegrationTest
assert_response 410
end
end
should "normalize search params" do
get tags_path, params: { search: { name: "bkub", post_count: "" } }
assert_redirected_to tags_path(search: { name: "bkub" })
end
end
end