port tests for score and randomDrop

This commit is contained in:
Matteo Pagliazzi
2015-12-09 10:21:15 +01:00
parent 72b2791bc4
commit 0f3b307f40
3 changed files with 30 additions and 88 deletions

View File

@@ -258,13 +258,7 @@ api.scoreTask = {
task.completed = direction === 'up';
}
let delta;
try {
delta = scoreTask({task, user, direction}, req);
} catch (e) {
throw e;
}
let delta = scoreTask({task, user, direction}, req);
// Drop system (don't run on the client, as it would only be discarded since ops are sent to the API, not the results)
if (direction === 'up') user.fns.randomDrop({task, delta}, req);