Commit 25dd1712 authored by Kamil Trzcinski's avatar Kamil Trzcinski

Add specs to test on_stop and action on environments

parent 50d97527
......@@ -64,6 +64,10 @@ module Gitlab
value[:action] || 'start'
end
def on_stop
value[:on_stop]
end
def value
case @config
when String then { name: @config, action: 'start' }
......
......@@ -101,7 +101,7 @@ describe Gitlab::Ci::Config::Node::Environment do
context 'when invalid action is used' do
let(:config) do
{ name: 'production',
action: false }
action: 'invalid' }
end
describe '#valid?' do
......@@ -144,7 +144,7 @@ describe Gitlab::Ci::Config::Node::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 on stop should be a string'
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