tests: no longer using shouldCron, test cron paths{} instead
This commit is contained in:
@@ -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})
|
||||
|
||||
Reference in New Issue
Block a user