Add Mocha specs for common back into the test suite

This commit is contained in:
Kevin Gisi
2015-03-26 14:52:03 -04:00
parent 695b00b6bb
commit bcd3d9a0b7
3 changed files with 13 additions and 8 deletions
+5 -5
View File
@@ -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')