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