modqueue: fix the disapproved: metatag showing posts outside the queue.

Fix a bug where filtering the modqueue by the `disapproved:<reason>` tag
would return posts outside the modqueue.
This commit is contained in:
evazion
2022-09-29 22:30:14 -05:00
parent d51cc17eaf
commit 559bf1ae0a
4 changed files with 49 additions and 4 deletions

View File

@@ -58,6 +58,16 @@ class ModqueueControllerTest < ActionDispatch::IntegrationTest
assert_equal([], response.parsed_body.pluck("id"))
end
should "filter the disapproved:<reason> metatag correctly" do
post1 = create(:post, is_pending: true)
post2 = create(:post, is_deleted: true)
create(:post_disapproval, post: post2, reason: "poor_quality")
get_auth modqueue_index_path(search: { tags: "disapproved:poor_quality" }), @admin, as: :json
assert_response :success
assert_equal([], response.parsed_body.pluck("id"))
end
should "include appealed posts in the modqueue" do
@appeal = create(:post_appeal)
get_auth modqueue_index_path, @admin