Add Mocha specs for common back into the test suite
This commit is contained in:
@@ -448,10 +448,10 @@ describe 'Cron', ->
|
||||
expect(user.lastCron).to.not.be.ok # it setup the cron property now
|
||||
|
||||
user.lastCron = +moment().subtract(1,'days')
|
||||
|
||||
|
||||
# this is hacky but should fix things for the moment
|
||||
user.flags.freeRebirth = true
|
||||
|
||||
|
||||
paths = {};user.fns.cron {paths}
|
||||
expect(user.lastCron).to.be.greaterThan 0
|
||||
|
||||
@@ -600,9 +600,9 @@ describe 'Cron', ->
|
||||
# should be 1 day later than lastCron
|
||||
lastCron = moment('2014-10-09 12:30:00')
|
||||
days = shared.daysSince(lastCron, {now: moment('2014-10-10 10:30:00'), dayStart})
|
||||
expect(days).to.eql 1
|
||||
expect(days).to.eql 1
|
||||
|
||||
it 'daysSince, last cron before new dayStart', ->
|
||||
xit 'daysSince, last cron before new dayStart', ->
|
||||
# If lastCron was after dayStart (at 1am) with dayStart set at 0, changing dayStart to 4am
|
||||
# should not trigger another cron the same day
|
||||
|
||||
@@ -621,7 +621,7 @@ describe 'Cron', ->
|
||||
task due days, user custom day start, timezoneOffset, etc - then runs cron, jumps to tomorrow and runs cron,
|
||||
and so on - testing each possible outcome along the way
|
||||
###
|
||||
|
||||
|
||||
runCron = (options) ->
|
||||
_.each [480, 240, 0, -120], (timezoneOffset) -> # test different timezones
|
||||
now = shared.startOfWeek({timezoneOffset}).add(options.currentHour||0, 'hours')
|
||||
|
||||
Reference in New Issue
Block a user