search: refactor to pass in the current user explicitly.

This commit is contained in:
evazion
2022-09-22 04:16:28 -05:00
parent b56b6c554b
commit 88ac91f5f3
82 changed files with 233 additions and 280 deletions

View File

@@ -95,9 +95,8 @@ class PostApprovalTest < ActiveSupport::TestCase
CurrentUser.scoped(@approver) do
@post.update!(tag_string: "touhou")
@approval = create(:post_approval, post: @post, user: @approver)
@approvals = PostApproval.search(user_name: @approver.name, post_tags_match: "touhou", post_id: @post.id)
assert_equal([@approval.id], @approvals.map(&:id))
assert_search_equals(@approval, user_name: @approver.name, post_tags_match: "touhou", post_id: @post.id)
end
end
end