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
db17e6ad
Commit
db17e6ad
authored
Jun 01, 2017
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
split tests for expanded_environment_url
parent
a0990ff3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
4 deletions
+25
-4
spec/models/ci/build_spec.rb
spec/models/ci/build_spec.rb
+25
-4
No files found.
spec/models/ci/build_spec.rb
View file @
db17e6ad
...
...
@@ -427,8 +427,8 @@ describe Ci::Build, :models do
end
end
describe
'#
ci
_environment_url'
do
subject
{
job
.
ci
_environment_url
}
describe
'#
expanded
_environment_url'
do
subject
{
job
.
expanded
_environment_url
}
context
'when yaml environment uses $CI_COMMIT_REF_NAME'
do
let
(
:job
)
do
...
...
@@ -453,10 +453,31 @@ describe Ci::Build, :models do
context
'when yaml environment does not have url'
do
let
(
:job
)
{
create
(
:ci_build
,
environment:
'staging'
)
}
it
{
is_expected
.
to
be_nil
}
end
end
describe
'#ci_environment_url'
do
subject
{
job
.
ci_environment_url
}
let!
(
:environment
)
do
create
(
:environment
,
project:
job
.
project
,
name:
job
.
environment
)
end
context
'when yaml environment has url'
do
let
(
:job
)
do
create
(
:ci_build
,
ref:
'master'
,
environment:
'staging'
,
options:
{
environment:
{
url:
'http://review/$CI_COMMIT_REF_NAME'
}
})
end
it
{
is_expected
.
to
eq
(
'http://review/master'
)
}
end
context
'when yaml environment does not have url'
do
let
(
:job
)
{
create
(
:ci_build
,
environment:
'staging'
)
}
it
'returns the external_url from persisted environment'
do
is_expected
.
to
eq
(
environment
.
external_url
)
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