finish PUT-tasks_id tests and fix some edge bugs

This commit is contained in:
Matteo Pagliazzi
2015-12-07 21:00:15 +01:00
parent 0272a36bac
commit 3c4491606b
3 changed files with 163 additions and 31 deletions

View File

@@ -43,16 +43,7 @@ describe('POST /tasks', () => {
})).to.eventually.be.rejected.and.eql({
code: 400,
error: 'BadRequest',
});
});
it('ignores setting userId field', () => {
return api.post('/tasks', {
text: 'test habit',
type: 'habit',
userId: 123,
}).then((task) => {
expect(task.userId).to.equal(user._id);
message: 'habit validation failed',
});
});