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
17faa8a2
Commit
17faa8a2
authored
Mar 04, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix specs for environments with manual actions
parent
9b27f49d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
19 deletions
+40
-19
builds.rb
spec/factories/ci/builds.rb
+1
-1
environment_spec.rb
spec/features/environment_spec.rb
+23
-9
environments_spec.rb
spec/features/environments_spec.rb
+16
-9
No files found.
spec/factories/ci/builds.rb
View file @
17faa8a2
...
...
@@ -57,7 +57,7 @@ FactoryGirl.define do
end
trait
:manual
do
status
'
skipped
'
status
'
manual
'
self
.
when
'manual'
end
...
...
spec/features/environment_spec.rb
View file @
17faa8a2
...
...
@@ -13,7 +13,7 @@ feature 'Environment', :feature do
feature
'environment details page'
do
given!
(
:environment
)
{
create
(
:environment
,
project:
project
)
}
given!
(
:deployment
)
{
}
given!
(
:
manual
)
{
}
given!
(
:
action
)
{
}
before
do
visit_environment
(
environment
)
...
...
@@ -69,17 +69,23 @@ feature 'Environment', :feature do
end
context
'with manual action'
do
given
(
:manual
)
{
create
(
:ci_build
,
:manual
,
pipeline:
pipeline
,
name:
'deploy to production'
)
}
given
(
:action
)
do
create
(
:ci_build
,
:manual
,
pipeline:
pipeline
,
name:
'deploy to production'
)
end
scenario
'does show a play button'
do
expect
(
page
).
to
have_link
(
manual
.
name
.
humanize
)
expect
(
page
).
to
have_link
(
action
.
name
.
humanize
)
end
scenario
'does allow to play manual action'
do
expect
(
manual
).
to
be_skipped
expect
{
click_link
(
manual
.
name
.
humanize
)
}.
not_to
change
{
Ci
::
Pipeline
.
count
}
expect
(
page
).
to
have_content
(
manual
.
name
)
expect
(
manual
.
reload
).
to
be_pending
expect
(
action
).
to
be_manual
expect
{
click_link
(
action
.
name
.
humanize
)
}
.
not_to
change
{
Ci
::
Pipeline
.
count
}
expect
(
page
).
to
have_content
(
action
.
name
)
expect
(
action
.
reload
).
to
be_pending
end
context
'with external_url'
do
...
...
@@ -130,8 +136,16 @@ feature 'Environment', :feature do
context
'when environment is available'
do
context
'with stop action'
do
given
(
:manual
)
{
create
(
:ci_build
,
:manual
,
pipeline:
pipeline
,
name:
'close_app'
)
}
given
(
:deployment
)
{
create
(
:deployment
,
environment:
environment
,
deployable:
build
,
on_stop:
'close_app'
)
}
given
(
:action
)
do
create
(
:ci_build
,
:manual
,
pipeline:
pipeline
,
name:
'close_app'
)
end
given
(
:deployment
)
do
create
(
:deployment
,
environment:
environment
,
deployable:
build
,
on_stop:
'close_app'
)
end
scenario
'does show stop button'
do
expect
(
page
).
to
have_link
(
'Stop'
)
...
...
spec/features/environments_spec.rb
View file @
17faa8a2
...
...
@@ -12,7 +12,7 @@ feature 'Environments page', :feature, :js do
given!
(
:environment
)
{
}
given!
(
:deployment
)
{
}
given!
(
:
manual
)
{
}
given!
(
:
action
)
{
}
before
do
visit_environments
(
project
)
...
...
@@ -90,7 +90,7 @@ feature 'Environments page', :feature, :js do
given
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
)
}
given
(
:build
)
{
create
(
:ci_build
,
pipeline:
pipeline
)
}
given
(
:
manual
)
do
given
(
:
action
)
do
create
(
:ci_build
,
:manual
,
pipeline:
pipeline
,
name:
'deploy to production'
)
end
...
...
@@ -102,19 +102,19 @@ feature 'Environments page', :feature, :js do
scenario
'does show a play button'
do
find
(
'.js-dropdown-play-icon-container'
).
click
expect
(
page
).
to
have_content
(
manual
.
name
.
humanize
)
expect
(
page
).
to
have_content
(
action
.
name
.
humanize
)
end
scenario
'does allow to play manual action'
,
js:
true
do
expect
(
manual
).
to
be_skipped
expect
(
action
).
to
be_manual
find
(
'.js-dropdown-play-icon-container'
).
click
expect
(
page
).
to
have_content
(
manual
.
name
.
humanize
)
expect
(
page
).
to
have_content
(
action
.
name
.
humanize
)
expect
{
click_link
(
manual
.
name
.
humanize
)
}
expect
{
click_link
(
action
.
name
.
humanize
)
}
.
not_to
change
{
Ci
::
Pipeline
.
count
}
expect
(
manual
.
reload
).
to
be_pending
expect
(
action
.
reload
).
to
be_pending
end
scenario
'does show build name and id'
do
...
...
@@ -144,8 +144,15 @@ feature 'Environments page', :feature, :js do
end
context
'with stop action'
do
given
(
:manual
)
{
create
(
:ci_build
,
:manual
,
pipeline:
pipeline
,
name:
'close_app'
)
}
given
(
:deployment
)
{
create
(
:deployment
,
environment:
environment
,
deployable:
build
,
on_stop:
'close_app'
)
}
given
(
:action
)
do
create
(
:ci_build
,
:manual
,
pipeline:
pipeline
,
name:
'close_app'
)
end
given
(
:deployment
)
do
create
(
:deployment
,
environment:
environment
,
deployable:
build
,
on_stop:
'close_app'
)
end
scenario
'does show stop button'
do
expect
(
page
).
to
have_selector
(
'.stop-env-link'
)
...
...
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