Send back flag data if user had flagged the message.

This commit is contained in:
Blade Barringer
2015-11-10 08:15:54 -06:00
parent 6b7a757459
commit 1fc21167dc
2 changed files with 17 additions and 3 deletions

View File

@@ -39,6 +39,17 @@ describe('POST /groups/:id/chat/:id/flag', () => {
expect(message.flagCount).to.eql(1);
});
});
it('cannot flag the same message twice', () => {
let api = requester(user);
return expect(api.post(`/groups/${group._id}/chat/${message.id}/flag`).then((messages) => {
return api.post(`/groups/${group._id}/chat/${message.id}/flag`);
})).to.eventually.be.rejected.and.eql({
code: 401,
text: t('messageGroupChatFlagAlreadyReported'),
});
});
});
context('own message', () => {