mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-13 15:38:59 +00:00
tests: no longer using shouldCron, test cron paths{} instead
This commit is contained in:
parent
18f0755e4e
commit
2c75f94254
1 changed files with 10 additions and 3 deletions
|
|
@ -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})
|
||||
|
|
|
|||
Loading…
Reference in a new issue