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
02c6cbf5
Commit
02c6cbf5
authored
Nov 23, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests
parent
afa5afc5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
12 deletions
+43
-12
show.html.haml
app/views/projects/builds/show.html.haml
+1
-2
show.html.haml_spec.rb
spec/views/projects/builds/show.html.haml_spec.rb
+42
-10
No files found.
app/views/projects/builds/show.html.haml
View file @
02c6cbf5
...
...
@@ -40,8 +40,7 @@
This build is the most recent deployment to
#{
environment_link_for_build
(
@build
.
project
,
@build
)
}
.
-
else
This build is an out-of-date deployment to
#{
environment_link_for_build
(
@build
.
project
,
@build
)
}
.
-
if
environment
.
try
(
:last_deployment
)
View the most recent deployment
#{
deployment_link
(
environment
.
last_deployment
)
}
.
View the most recent deployment
#{
deployment_link
(
environment
.
last_deployment
)
}
.
-
elsif
@build
.
complete?
&&
!
@build
.
success?
The deployment of this build to
#{
environment_link_for_build
(
@build
.
project
,
@build
)
}
did not succeed.
-
else
...
...
spec/views/projects/builds/show.html.haml_spec.rb
View file @
02c6cbf5
...
...
@@ -88,16 +88,46 @@ describe 'projects/builds/show', :view do
create
(
:ci_build
,
:running
,
environment:
'staging'
,
pipeline:
pipeline
)
end
let!
(
:environment
)
do
create
(
:environment
,
name:
'staging'
,
project:
project
)
end
it
'shows deployment message'
do
expected_text
=
'This build is creating a deployment to staging'
render
expect
(
rendered
).
to
have_css
(
'.environment-information'
,
text:
expected_text
)
context
'and environment does exist'
do
let!
(
:environment
)
do
create
(
:environment
,
name:
'staging'
,
project:
project
)
end
it
'shows deployment message'
do
expected_text
=
'This build is creating a deployment to staging'
render
expect
(
rendered
).
to
have_css
(
'.environment-information'
,
text:
expected_text
)
end
context
'and has deployment'
do
let!
(
:deployment
)
do
create
(
:deployment
,
environment:
environment
)
end
it
'shows that deployment will be overwritten'
do
expected_text
=
'This build is creating a deployment to staging'
render
expect
(
rendered
).
to
have_css
(
'.environment-information'
,
text:
expected_text
)
expect
(
rendered
).
to
have_css
(
'.environment-information'
,
text:
'latest deployment'
)
end
end
end
context
'and environment does not exist'
do
it
'shows deployment message'
do
expected_text
=
'This build is creating a deployment to staging'
render
expect
(
rendered
).
to
have_css
(
'.environment-information'
,
text:
expected_text
)
expect
(
rendered
).
not_to
have_css
(
'.environment-information'
,
text:
'latest deployment'
)
end
end
end
...
...
@@ -134,6 +164,8 @@ describe 'projects/builds/show', :view do
expect
(
rendered
).
to
have_css
(
'.environment-information'
,
text:
expected_text
)
expect
(
rendered
).
not_to
have_css
(
'.environment-information'
,
text:
'latest deployment'
)
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