Fix nested blank search params not being stripped from searches.

From https://danbooru.donmai.us/forum_topics/9127?page=258#forum_post_151308:

    When you do a user search (from https://danbooru.donmai.us/users/search)
    the results only include those with someone in the inviter field.

The bug was that nested blank search params (/users?search[inviter][name_matches]=)
didn't get stripped from the search.
This commit is contained in:
evazion
2018-10-17 16:11:44 -05:00
parent f4be87d4b7
commit 6148cb39a2
2 changed files with 15 additions and 8 deletions

View File

@@ -26,6 +26,11 @@ class UsersControllerTest < ActionDispatch::IntegrationTest
get users_path, params: {:search => {:name_matches => @user.name}}
assert_response :success
end
should "list all users (with blank search parameters)" do
get users_path, params: { search: { inviter: { name_matches: "" }, level: "", name: "test" } }
assert_redirected_to users_path(search: { name: "test" })
end
end
context "show action" do