Re-enable skipped `Scheduler::ScheduleInfo` test.

This commit is contained in:
Guo Xiang Tan 2017-07-25 00:03:03 +09:00
parent 8ee31d3c85
commit d940166a89
2 changed files with 6 additions and 2 deletions

View File

@ -63,7 +63,7 @@ module Scheduler
return if valid?
at = @klass.daily[:at] || 0
today_begin = Time.now.midnight.to_i
today_begin = Time.zone.now.midnight.to_i
today_offset = DateTime.now.seconds_since_midnight
# If it's later today

View File

@ -82,9 +82,13 @@ describe Scheduler::ScheduleInfo do
expect(@info.valid?).to eq(false)
end
skip "will have a due date at the appropriate time if blank" do
it "will have a due date at the appropriate time if blank" do
expect(@info.next_run).to eq(nil)
@info.schedule!
expect(JSON.parse($redis.get(@info.key))["next_run"])
.to eq((Time.zone.now.midnight + 2.hours).to_i)
expect(@info.valid?).to eq(true)
end