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
Boxiang Sun
gitlab-ce
Commits
7d12683d
Commit
7d12683d
authored
Oct 11, 2016
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes broken tests
parent
594c3208
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
3 deletions
+53
-3
spec/features/environments_spec.rb
spec/features/environments_spec.rb
+44
-3
spec/features/merge_requests/merge_when_build_succeeds_spec.rb
...features/merge_requests/merge_when_build_succeeds_spec.rb
+9
-0
No files found.
spec/features/environments_spec.rb
View file @
7d12683d
...
...
@@ -46,6 +46,14 @@ feature 'Environments', feature: true do
scenario
'does show environment name'
do
expect
(
page
).
to
have_link
(
environment
.
name
)
end
scenario
'does show number of opened environments in Availabe tab'
do
expect
(
page
.
find
(
'.js-avaibale-environments-count'
).
text
).
to
eq
(
'1'
)
end
scenario
'does show number of closed environments in Stopped tab'
do
expect
(
page
.
find
(
'.js-stopped-environments-count'
).
text
).
to
eq
(
'0'
)
end
context
'without deployments'
do
scenario
'does show no deployments'
do
...
...
@@ -76,6 +84,16 @@ feature 'Environments', feature: true do
expect
(
page
).
to
have_content
(
manual
.
name
)
expect
(
manual
.
reload
).
to
be_pending
end
scenario
'does show close button'
do
# TODO: Add test to verify if close button is visible
# This needs to be true: if local_assigns.fetch(:allow_close, false) && deployment.closeable?
end
scenario
'does allow to close environment'
do
# TODO: Add test to verify if close environment works
# This needs to be true: if local_assigns.fetch(:allow_close, false) && deployment.closeable?
end
end
end
end
...
...
@@ -137,6 +155,16 @@ feature 'Environments', feature: true do
expect
(
page
).
to
have_content
(
manual
.
name
)
expect
(
manual
.
reload
).
to
be_pending
end
scenario
'does show close button'
do
# TODO: Add test to verify if close button is visible
# This needs to be true: if local_assigns.fetch(:allow_close, false) && deployment.closeable?
end
scenario
'does allow to close environment'
do
# TODO: Add test to verify if close environment works
# This needs to be true: if local_assigns.fetch(:allow_close, false) && deployment.closeable?
end
end
end
end
...
...
@@ -194,9 +222,22 @@ feature 'Environments', feature: true do
context
'when logged as master'
do
given
(
:role
)
{
:master
}
scenario
'does close environment'
do
click_link
'Close'
expect
(
page
).
not_to
have_link
(
environment
.
name
)
scenario
'does not have a Close link'
do
expect
(
page
).
not_to
have_link
(
'Close'
)
end
context
'when environment is opened and can be closed'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:environment
)
{
create
(
:environment
,
project:
project
)
}
let!
(
:deployment
)
do
create
(
:deployment
,
environment:
environment
,
sha:
project
.
commit
(
'master'
).
id
)
end
scenario
'does have a Close link'
do
# TODO: Add missing validation. In order to have Close link
# this must be true: last_deployment.try(:close_action)
end
end
end
...
...
spec/features/merge_requests/merge_when_build_succeeds_spec.rb
View file @
7d12683d
...
...
@@ -79,6 +79,15 @@ feature 'Merge When Build Succeeds', feature: true, js: true do
end
end
context
'Has Environment'
do
let
(
:environment
)
{
create
(
:environment
,
project:
project
)
}
it
'does show link to close the environment'
do
# TODO add test to verify if the button is visible when this condition
# is met: if environment.closeable?
end
end
def
visit_merge_request
(
merge_request
)
visit
namespace_project_merge_request_path
(
merge_request
.
project
.
namespace
,
merge_request
.
project
,
merge_request
)
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