This commit is contained in:
Sam
2013-06-20 17:42:15 +10:00
parent 6491bda4ab
commit 4a8a663a67
12 changed files with 172 additions and 36 deletions

View File

@@ -84,6 +84,20 @@ describe PostAction do
PostAction.flagged_posts_count.should == 0
end
it "should ignore validated flags" do
admin = Fabricate(:admin)
PostAction.act(codinghorror, post, PostActionType.types[:off_topic])
post.hidden.should be_false
PostAction.defer_flags!(post, admin.id)
PostAction.flagged_posts_count.should == 0
post.reload
post.hidden.should be_false
PostAction.hide_post!(post)
post.reload
post.hidden.should be_true
end
end
describe "when a user bookmarks something" do
@@ -220,7 +234,7 @@ describe PostAction do
u2 = Fabricate(:walter_white)
admin = Fabricate(:admin) # we need an admin for the messages
SiteSetting.flags_required_to_hide_post = 2
SiteSetting.stubs(:flags_required_to_hide_post).returns(2)
PostAction.act(u1, post, PostActionType.types[:spam])
PostAction.act(u2, post, PostActionType.types[:spam])