flagging work, we should be clearing from the mod menu if a topic or post is deleted

This commit is contained in:
Sam Saffron
2013-02-06 12:13:41 +11:00
parent 3fd019c6bd
commit 6f2f7b0589
5 changed files with 35 additions and 4 deletions

View File

@@ -27,6 +27,19 @@ describe PostAction do
PostAction.flagged_posts_count.should == 0
end
it "should reset counts when a topic is deleted" do
PostAction.act(codinghorror, post, PostActionType.Types[:off_topic])
post.topic.destroy
PostAction.flagged_posts_count.should == 0
end
it "should reset counts when a post is deleted" do
post2 = Fabricate(:post, topic_id: post.topic_id)
PostAction.act(codinghorror, post2, PostActionType.Types[:off_topic])
post2.destroy
PostAction.flagged_posts_count.should == 0
end
end
it "increases the post's bookmark count when saved" do