Merge pull request #207 from coralproject/fix-test

Fix test on Suspected words
This commit is contained in:
Gabriela Rodríguez Berón
2017-01-03 11:45:30 -03:00
committed by GitHub
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -137,7 +137,7 @@ router.post('/', wordlist.filter('body'), (req, res, next) => {
.then((comment) => {
if (req.wordlist.suspect) {
return Comment
.addAction(comment.id, null, 'flag', 'body', 'Matched suspect word filters.')
.addAction(comment.id, null, 'flag', {field: 'body', details: 'Matched suspect word filters.'})
.then(() => comment);
}
+3 -2
View File
@@ -225,8 +225,9 @@ describe('/api/v1/comments', () => {
let action = actions[0];
expect(action).to.have.property('item_id', comment.id);
expect(action).to.have.property('field', 'body');
expect(action).to.have.property('detail', 'Matched suspect word filters.');
expect(action).to.have.property('metadata');
expect(action.metadata).to.have.property('field', 'body');
expect(action.metadata).to.have.property('details', 'Matched suspect word filters.');
});
});