admins can now clear flags inline

This commit is contained in:
Sam Saffron
2013-02-07 15:15:48 +11:00
parent 0f5bef61dc
commit c7461622a9
10 changed files with 86 additions and 10 deletions

View File

@@ -54,12 +54,29 @@ describe Post do
topic.user.trust_level = TrustLevel.Levels[:moderator]
Fabricate.build(:post, post_args).should be_valid
end
end
end
describe 'flagging helpers' do
it 'isFlagged is accurate' do
post = Fabricate(:post)
user = Fabricate(:coding_horror)
PostAction.act(user, post, PostActionType.Types[:off_topic])
PostAction.act(post.user, post, PostActionType.Types[:spam])
post.reload
post.is_flagged?.should == true
PostAction.remove_act(post.user, post, PostActionType.Types[:spam])
post.reload
post.is_flagged?.should == true
PostAction.remove_act(user, post, PostActionType.Types[:off_topic])
post.reload
post.is_flagged?.should == false
end
end
describe 'message bus' do
it 'enqueues the post on the message bus' do