Fix /uploads?search[uploader_name] not filtering by uploader name.

Caused by `relation = self` in `search_post_id_attribute`.
This commit is contained in:
evazion
2019-09-02 19:53:47 -05:00
parent 5df3b01ca2
commit 1e0aadb6e7
2 changed files with 8 additions and 5 deletions

View File

@@ -137,6 +137,7 @@ class UploadsControllerTest < ActionDispatch::IntegrationTest
setup do
as_user do
@upload = create(:source_upload, tag_string: "foo bar")
@upload2 = create(:source_upload, tag_string: "tagme", rating: "e")
end
end
@@ -151,14 +152,16 @@ class UploadsControllerTest < ActionDispatch::IntegrationTest
uploader_name: @upload.uploader.name,
source_matches: @upload.source,
rating: @upload.rating,
has_post: "yes",
post_tags_match: @upload.tag_string,
status: @upload.status,
server: @upload.server,
}
get uploads_path, params: { search: search_params }
assert_response :success
get uploads_path(format: :json), params: { search: search_params }
assert_response :success
assert_equal(@upload.id, response.parsed_body.first["id"])
end
end
end