Commit cc6ac794 authored by Shinya Maeda's avatar Shinya Maeda

Define next_time as let in trigger_schedule_spec

parent 1a244c64
...@@ -7,13 +7,13 @@ describe Ci::TriggerSchedule, models: true do ...@@ -7,13 +7,13 @@ describe Ci::TriggerSchedule, models: true do
describe '#schedule_next_run!' do describe '#schedule_next_run!' do
let(:trigger_schedule) { create(:ci_trigger_schedule, :nightly) } let(:trigger_schedule) { create(:ci_trigger_schedule, :nightly) }
let(:next_time) { Gitlab::Ci::CronParser.new(trigger_schedule.cron, trigger_schedule.cron_timezone).next_time_from(Time.now) }
before do before do
trigger_schedule.schedule_next_run! trigger_schedule.schedule_next_run!
end end
it 'updates next_run_at' do it 'updates next_run_at' do
next_time = Gitlab::Ci::CronParser.new(trigger_schedule.cron, trigger_schedule.cron_timezone).next_time_from(Time.now)
expect(Ci::TriggerSchedule.last.next_run_at).to eq(next_time) expect(Ci::TriggerSchedule.last.next_run_at).to eq(next_time)
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment