Fixes multiple complete and uncomplete for todos and daily (Fixes #8669) (#8971)

* Fixed bug that allows users to complete todo and daily multiple times

* Added tests

* Fix syntax

* Fix existing tests that rely on multiple complete or uncomplete

* Undoes removal of website/client/README.md

* Change sessionOutdated string to reflect separate client needs

* Fix should update history test by changing lastCron
This commit is contained in:
Asif Mallik
2017-11-28 08:13:18 +06:00
committed by Sabe Jones
parent 26bde1f766
commit 299e88233c
4 changed files with 63 additions and 13 deletions

View File

@@ -82,6 +82,13 @@ describe('POST /tasks/:id/score/:direction', () => {
});
it('should update the history', async () => {
let newCron = new Date(2015, 11, 20);
await user.post('/debug/set-cron', {
lastCron: newCron,
});
await user.post('/cron');
await user.post(`/tasks/${usersChallengeTaskId}/score/up`);
let tasks = await user.get(`/tasks/challenge/${challenge._id}`);