This commit is contained in:
r888888888
2014-03-18 11:21:10 -07:00
parent 97dcfa3d2a
commit de34d21f76
6 changed files with 56 additions and 0 deletions

View File

@@ -14,6 +14,19 @@ class ForumTopicTest < ActiveSupport::TestCase
CurrentUser.ip_addr = nil
end
context "#merge" do
setup do
@topic2 = FactoryGirl.create(:forum_topic, :title => "yyy")
FactoryGirl.create(:forum_post, :topic_id => @topic.id, :body => "xxx")
FactoryGirl.create(:forum_post, :topic_id => @topic2.id, :body => "xxx")
end
should "merge all the posts in one topic into the other" do
@topic.merge(@topic2)
assert_equal(2, @topic.posts.count)
end
end
context "#read_by?" do
context "for a topic that was never read by the user" do
should "return false" do