From 2c75f94254b488bfa85fad826e8721ce44c5303f Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Mon, 19 Aug 2013 00:31:07 -0400 Subject: [PATCH] tests: no longer using shouldCron, test cron paths{} instead --- tests/algos.mocha.coffee | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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})