Moved approval to subdoc

This commit is contained in:
Keith Holliday
2016-10-26 16:01:43 -05:00
parent 5b240a1950
commit 59e1de6771
7 changed files with 24 additions and 22 deletions
@@ -63,8 +63,8 @@ describe('POST /tasks/:id/approve/:userId', () => {
expect(member.notifications[0].type).to.equal('GROUP_TASK_APPROVAL');
expect(member.notifications[0].data.message).to.equal(t('yourTaskHasBeenApproved'));
expect(syncedTask.group.approved).to.be.true;
expect(syncedTask.group.approvingUser).to.equal(user._id);
expect(syncedTask.group.approvedDate).to.be.a('string'); // date gets converted to a string as json doesn't have a Date type
expect(syncedTask.group.approval.approved).to.be.true;
expect(syncedTask.group.approval.approvingUser).to.equal(user._id);
expect(syncedTask.group.approval.dateApproved).to.be.a('string'); // date gets converted to a string as json doesn't have a Date type
});
});
@@ -50,8 +50,8 @@ describe('POST /tasks/:id/score/:direction', () => {
}));
expect(response.message).to.equal(t('taskApprovalHasBeenRequested'));
expect(updatedTask.group.approvalRequested).to.equal(true);
expect(updatedTask.group.approvalRequestedDate).to.be.a('string'); // date gets converted to a string as json doesn't have a Date type
expect(updatedTask.group.approval.requested).to.equal(true);
expect(updatedTask.group.approval.requestedDate).to.be.a('string'); // date gets converted to a string as json doesn't have a Date type
});
it('errors when approval has already been requested', async () => {