add categories to forum topics
This commit is contained in:
@@ -3,5 +3,6 @@ FactoryGirl.define do
|
||||
title {Faker::Lorem.words.join(" ")}
|
||||
is_sticky false
|
||||
is_locked false
|
||||
category_id 0
|
||||
end
|
||||
end
|
||||
|
||||
@@ -27,6 +27,11 @@ class ForumTopicTest < ActiveSupport::TestCase
|
||||
assert_equal(0, ForumTopic.title_matches("aaa").count)
|
||||
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)
|
||||
end
|
||||
|
||||
should "initialize its creator" do
|
||||
assert_equal(@user.id, @topic.creator_id)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user