Model#search: refactor searching for attributes.
This commit is contained in:
@@ -133,8 +133,8 @@ class ForumTopicTest < ActiveSupport::TestCase
|
||||
end
|
||||
|
||||
should "be searchable by title" do
|
||||
assert_equal(1, ForumTopic.attribute_matches(:title, "xxx").count)
|
||||
assert_equal(0, ForumTopic.attribute_matches(:title, "aaa").count)
|
||||
assert_equal(1, ForumTopic.search(title: "xxx").count)
|
||||
assert_equal(0, ForumTopic.search(title: "aaa").count)
|
||||
end
|
||||
|
||||
should "be searchable by category id" do
|
||||
|
||||
Reference in New Issue
Block a user