Don't allow users to double flag stuff

Correct seed fu to match model
This commit is contained in:
Sam Saffron
2013-02-07 10:45:58 +11:00
parent 204a8a8b52
commit f79f0e740a
5 changed files with 26 additions and 4 deletions

View File

@@ -111,6 +111,13 @@ describe PostAction do
describe 'flagging' do
it 'does not allow you to flag stuff with 2 reasons' do
post = Fabricate(:post)
u1 = Fabricate(:evil_trout)
PostAction.act(u1, post, PostActionType.Types[:spam])
lambda { PostAction.act(u1, post, PostActionType.Types[:off_topic]) }.should raise_error(PostAction::AlreadyFlagged)
end
it 'should update counts when you clear flags' do
post = Fabricate(:post)
u1 = Fabricate(:evil_trout)