fix dateCompleted not remove from un-completed todos and fix tasks test

This commit is contained in:
Matteo Pagliazzi
2016-01-18 15:01:46 +01:00
parent d93cabafb9
commit ee854229c7
5 changed files with 5 additions and 65 deletions
@@ -46,6 +46,7 @@ describe('POST /tasks/:id/score/:direction', () => {
let task = await user.get(`/tasks/${todo._id}`);
expect(task.completed).to.equal(true);
expect(task.dateCompleted).to.be.a('string'); // date gets converted to a string as json doesn't have a Date type
});
it('moves completed todos out of user.tasksOrder.todos', async () => {
@@ -81,6 +82,7 @@ describe('POST /tasks/:id/score/:direction', () => {
let updatedTask = await user.get(`/tasks/${todo._id}`);
expect(updatedTask.completed).to.equal(false);
expect(updatedTask.dateCompleted).to.be.a('undefined');
});
it('scores up todo even if it is already completed'); // Yes?
@@ -95,9 +95,6 @@ describe('POST /tasks/user', () => {
expect(updatedTasks).to.eql(originalTasks);
});
let updatedTasks = await user.get('/tasks');
expect(updatedTasks).to.eql(originalTasks);
});
it('automatically sets "task.userId" to user\'s uuid', async () => {