diff --git a/tests/algos.mocha.coffee b/tests/algos.mocha.coffee index 2adfddddb2..cf3d872a87 100644 --- a/tests/algos.mocha.coffee +++ b/tests/algos.mocha.coffee @@ -110,12 +110,19 @@ describe 'Cron', -> it 'computes shouldCron', -> user = helpers.newUser() - expect(algos.shouldCron(user)).to.be true # handlomg lastCron='new' + paths = {};algos.cron user, {paths} + expect(paths.lastCron).to.be true # handlomg lastCron='new' + + paths = {};algos.cron user, {paths} + expect(paths.lastCron).to.not.be.ok # it setup the cron property now + user.lastCron = +moment().subtract('days',1) - expect(algos.shouldCron(user)).to.be true + paths = {};algos.cron user, {paths} + expect(paths.lastCron).to.be true user.lastCron = +moment().add('days',1) - expect(algos.shouldCron(user)).to.be false + paths = {};algos.cron user, {paths} + expect(paths.lastCron).to.be true # busted cron (was set to after today's date) it 'only dailies & todos are effected', -> {before,after} = beforeAfter({daysAgo:1})