diff options
author | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-04-01 23:27:24 +0900 |
---|---|---|
committer | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-04-06 23:46:58 +0900 |
commit | 97cc6777368bfe171198af383bf715629e9b076f (patch) | |
tree | 7f32a9e7aef365cb234457653712eea9b0b29581 /spec | |
parent | 1bd5494942853decbcd67434ef592ca2523a777b (diff) | |
download | gitlab-ce-97cc6777368bfe171198af383bf715629e9b076f.tar.gz |
Commentout check_cron_frequency
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/ci/trigger_schedule_spec.rb | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/spec/models/ci/trigger_schedule_spec.rb b/spec/models/ci/trigger_schedule_spec.rb index 57ebcdfb3f1..8b27ca1c8b2 100644 --- a/spec/models/ci/trigger_schedule_spec.rb +++ b/spec/models/ci/trigger_schedule_spec.rb @@ -12,33 +12,8 @@ describe Ci::TriggerSchedule, models: true do expect(trigger_schedule.errors[:ref].first).to include('does not exist') end - describe 'cron limitation' do - let(:trigger_schedule) { create(:ci_trigger_schedule, :cron_nightly_build) } - - before do - trigger_schedule.cron = cron - trigger_schedule.valid? - end - - context 'when cron frequency is too short' do - let(:cron) { '0 * * * *' } # 00:00, 01:00, 02:00, ..., 23:00 - - it 'gets an error' do - expect(trigger_schedule.errors[:cron].first).to include('can not be less than 1 hour') - end - end - - context 'when cron frequency is eligible' do - let(:cron) { '0 0 1 1 *' } # every 00:00, January 1st - - it 'gets no errors' do - expect(trigger_schedule.errors[:cron]).to be_empty - end - end - end - describe '#schedule_next_run!' do - let(:trigger_schedule) { create(:ci_trigger_schedule, :cron_nightly_build) } + let(:trigger_schedule) { create(:ci_trigger_schedule, :cron_nightly_build, next_run_at: nil) } before do trigger_schedule.schedule_next_run! |