BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
4 deletions
+25
-4
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'
)
}
let!
(
:environment
)
do
create
(
:environment
,
project:
job
.
project
,
name:
job
.
environment
)
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