Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
25dd1712
Commit
25dd1712
authored
Oct 17, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs to test on_stop and action on environments
parent
50d97527
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
lib/gitlab/ci/config/node/environment.rb
lib/gitlab/ci/config/node/environment.rb
+4
-0
spec/lib/gitlab/ci/config/node/environment_spec.rb
spec/lib/gitlab/ci/config/node/environment_spec.rb
+2
-2
No files found.
lib/gitlab/ci/config/node/environment.rb
View file @
25dd1712
...
...
@@ -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'
}
...
...
spec/lib/gitlab/ci/config/node/environment_spec.rb
View file @
25dd1712
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment