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

@@ -44,13 +44,13 @@ class ForumTopicTest < ActiveSupport::TestCase
end
should "be searchable by title" do
assert_equal(1, ForumTopic.search(title: "xxx").count)
assert_equal(0, ForumTopic.search(title: "aaa").count)
assert_search_equals(@topic, title: "xxx")
assert_search_equals([], title: "aaa")
end
should "be searchable by category id" do
assert_equal(1, ForumTopic.search(:category_id => 0).count)
assert_equal(0, ForumTopic.search(:category_id => 1).count)
assert_search_equals(@topic, category_id: 0)
assert_search_equals([], category_id: 1)
end
should "initialize its creator" do