summaryrefslogtreecommitdiff
path: root/spec/features
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-11-10 13:59:26 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2016-11-10 13:59:26 +0100
commit1494abe982583c564969baaba7daa251ef333156 (patch)
tree681b777b50e645e6af0496bc808a2c071a4250ee /spec/features
parent13a680e343bdcd905c9134c57202fdec7d436d96 (diff)
downloadgitlab-ce-1494abe982583c564969baaba7daa251ef333156.tar.gz
Allow to stop any environment
Diffstat (limited to 'spec/features')
-rw-r--r--spec/features/environments_spec.rb22
1 files changed, 18 insertions, 4 deletions
diff --git a/spec/features/environments_spec.rb b/spec/features/environments_spec.rb
index b565586ee14..7c9584f6bf1 100644
--- a/spec/features/environments_spec.rb
+++ b/spec/features/environments_spec.rb
@@ -149,6 +149,24 @@ feature 'Environments', feature: true do
scenario 'does show no deployments' do
expect(page).to have_content('You don\'t have any deployments right now.')
end
+
+ context 'for available environment' do
+ given(:environment) { create(:environment, project: project, state: :available) }
+
+ scenario 'does allow to stop environment' do
+ click_link('Stop')
+
+ expect(page).to have_content(environment.name.titleize)
+ end
+ end
+
+ context 'for stopped environment' do
+ given(:environment) { create(:environment, project: project, state: :stopped) }
+
+ scenario 'does not shows stop button' do
+ expect(page).not_to have_link('Stop')
+ end
+ end
end
context 'with deployments' do
@@ -175,10 +193,6 @@ feature 'Environments', feature: true do
expect(page).to have_link('Re-deploy')
end
- scenario 'does not show stop button' do
- expect(page).not_to have_link('Stop')
- end
-
context 'with manual action' do
given(:manual) { create(:ci_build, :manual, pipeline: pipeline, name: 'deploy to production') }