tests: first pass at cron tests

This commit is contained in:
Tyler Renelle
2013-05-25 16:32:58 +01:00
parent 85eb6789ac
commit c4e18b5f04
2 changed files with 63 additions and 20 deletions
+1 -1
View File
@@ -329,7 +329,7 @@ obj.shouldCron = (user, options={}) ->
{user}
###
obj.cron = (user, options={}) ->
[paths, now] = [options.paths || {}, options.now || +new Date]
[paths, now] = [options.paths || {}, +options.now || +new Date]
# New user (!lastCron, lastCron==new) or it got busted somehow, maybe they went to a different timezone
if !user.lastCron? or user.lastCron is 'new' or moment(user.lastCron).isAfter(now)