tests: no longer using shouldCron, test cron paths{} instead

This commit is contained in:
Tyler Renelle 2013-08-19 00:31:07 -04:00
parent 18f0755e4e
commit 2c75f94254

View file

@ -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})