diff options
Diffstat (limited to 'spec/lib/gitlab/ci/config/entry/environment_spec.rb')
-rw-r--r-- | spec/lib/gitlab/ci/config/entry/environment_spec.rb | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/spec/lib/gitlab/ci/config/entry/environment_spec.rb b/spec/lib/gitlab/ci/config/entry/environment_spec.rb index 8c21d5342cc..0c18a7fb71e 100644 --- a/spec/lib/gitlab/ci/config/entry/environment_spec.rb +++ b/spec/lib/gitlab/ci/config/entry/environment_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Config::Entry::Environment do +RSpec.describe Gitlab::Ci::Config::Entry::Environment do let(:entry) { described_class.new(config) } before do @@ -102,6 +102,17 @@ describe Gitlab::Ci::Config::Entry::Environment do end end + context 'when prepare action is used' do + let(:config) do + { name: 'production', + action: 'prepare' } + end + + it 'is valid' do + expect(entry).to be_valid + end + end + context 'when wrong action type is used' do let(:config) do { name: 'production', @@ -137,7 +148,7 @@ describe Gitlab::Ci::Config::Entry::Environment do describe '#errors' do it 'contains error about invalid action' do expect(entry.errors) - .to include 'environment action should be start or stop' + .to include 'environment action should be start, stop or prepare' end end end |