summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/ci/config/entry/job_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab/ci/config/entry/job_spec.rb')
-rw-r--r--spec/lib/gitlab/ci/config/entry/job_spec.rb15
1 files changed, 11 insertions, 4 deletions
diff --git a/spec/lib/gitlab/ci/config/entry/job_spec.rb b/spec/lib/gitlab/ci/config/entry/job_spec.rb
index d745c4ca2ad..1169938b80c 100644
--- a/spec/lib/gitlab/ci/config/entry/job_spec.rb
+++ b/spec/lib/gitlab/ci/config/entry/job_spec.rb
@@ -44,9 +44,7 @@ describe Gitlab::Ci::Config::Entry::Job do
context 'when start_in is specified' do
let(:config) { { script: 'echo', when: 'delayed', start_in: '1 day' } }
- it 'returns error about invalid type' do
- expect(entry).to be_valid
- end
+ it { expect(entry).to be_valid }
end
end
end
@@ -158,7 +156,7 @@ describe Gitlab::Ci::Config::Entry::Job do
end
end
- context 'when start_in is not formateed ad a duration' do
+ context 'when start_in is not formatted as a duration' do
let(:config) { { when: 'delayed', start_in: 'test' } }
it 'returns error about invalid type' do
@@ -166,6 +164,15 @@ describe Gitlab::Ci::Config::Entry::Job do
expect(entry.errors).to include 'job start in should be a duration'
end
end
+
+ context 'when start_in is longer than one day' do
+ let(:config) { { when: 'delayed', start_in: '2 days' } }
+
+ it 'returns error about exceeding the limit' do
+ expect(entry).not_to be_valid
+ expect(entry.errors).to include 'job start in should not exceed the limit'
+ end
+ end
end
context 'when start_in specified without delayed specification' do