fix tasks updating and reminders tests

This commit is contained in:
Matteo Pagliazzi
2016-04-03 22:11:22 +02:00
parent f3abdaf692
commit c3945de098
4 changed files with 7 additions and 30 deletions

View File

@@ -152,14 +152,14 @@ describe('POST /tasks/user', () => {
text: 'test habit',
type: 'habit',
reminders: [
{id: id1, startDate: new Date(), time: new Date()},
{_id: id1, startDate: new Date(), time: new Date()},
],
});
expect(task.reminders).to.be.an('array');
expect(task.reminders.length).to.eql(1);
expect(task.reminders[0]).to.be.an('object');
expect(task.reminders[0].id).to.eql(id1);
expect(task.reminders[0]._id).to.eql(id1);
expect(task.reminders[0].startDate).to.be.a('string'); // json doesn't have dates
expect(task.reminders[0].time).to.be.a('string');
});