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

@@ -142,9 +142,10 @@ class ForumPostTest < ActiveSupport::TestCase
end
should "be searchable by body content" do
post = FactoryBot.create(:forum_post, :topic_id => @topic.id, :body => "xxx")
assert_equal(1, ForumPost.search(body_matches: "xxx").count)
assert_equal(0, ForumPost.search(body_matches: "aaa").count)
post = create(:forum_post, topic: @topic, body: "xxx")
assert_search_equals(post, body_matches: "xxx")
assert_search_equals([], body_matches: "aaa")
end
should "initialize its creator" do