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
ee592f0d
Commit
ee592f0d
authored
Apr 06, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve specs related to CI/CD job environment
parent
c3af43c3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
spec/models/ci/build_spec.rb
spec/models/ci/build_spec.rb
+12
-8
No files found.
spec/models/ci/build_spec.rb
View file @
ee592f0d
...
...
@@ -902,22 +902,26 @@ describe Ci::Build, :models do
end
describe
'#persisted_environment'
do
before
do
@environment
=
create
(
:environment
,
project:
project
,
name:
"foo-
#{
project
.
default_branch
}
"
)
let!
(
:environment
)
do
create
(
:environment
,
project:
project
,
name:
"foo-
#{
project
.
default_branch
}
"
)
end
subject
{
build
.
persisted_environment
}
context
'referenced literally'
do
let
(
:build
)
{
create
(
:ci_build
,
pipeline:
pipeline
,
environment:
"foo-
#{
project
.
default_branch
}
"
)
}
context
'when referenced literally'
do
let
(
:build
)
do
create
(
:ci_build
,
pipeline:
pipeline
,
environment:
"foo-
#{
project
.
default_branch
}
"
)
end
it
{
is_expected
.
to
eq
(
@
environment
)
}
it
{
is_expected
.
to
eq
(
environment
)
}
end
context
'referenced with a variable'
do
let
(
:build
)
{
create
(
:ci_build
,
pipeline:
pipeline
,
environment:
"foo-$CI_COMMIT_REF_NAME"
)
}
context
'when referenced with a variable'
do
let
(
:build
)
do
create
(
:ci_build
,
pipeline:
pipeline
,
environment:
"foo-$CI_COMMIT_REF_NAME"
)
end
it
{
is_expected
.
to
eq
(
@
environment
)
}
it
{
is_expected
.
to
eq
(
environment
)
}
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