summaryrefslogtreecommitdiff
path: root/spec/features/projects/environments
diff options
context:
space:
mode:
Diffstat (limited to 'spec/features/projects/environments')
-rw-r--r--spec/features/projects/environments/environment_spec.rb17
-rw-r--r--spec/features/projects/environments/environments_spec.rb16
2 files changed, 19 insertions, 14 deletions
diff --git a/spec/features/projects/environments/environment_spec.rb b/spec/features/projects/environments/environment_spec.rb
index 0c34309c1f4..4c5dda29fee 100644
--- a/spec/features/projects/environments/environment_spec.rb
+++ b/spec/features/projects/environments/environment_spec.rb
@@ -102,8 +102,8 @@ describe 'Environment' do
context 'with terminal' do
shared_examples 'same behavior between KubernetesService and Platform::Kubernetes' do
- context 'for project master' do
- let(:role) { :master }
+ context 'for project maintainer' do
+ let(:role) { :maintainer }
it 'it shows the terminal button' do
expect(page).to have_terminal_button
@@ -166,7 +166,8 @@ describe 'Environment' do
end
it 'allows to stop environment' do
- click_link('Stop')
+ click_button('Stop')
+ click_button('Stop environment') # confirm modal
expect(page).to have_content('close_app')
end
@@ -174,7 +175,7 @@ describe 'Environment' do
context 'when user has no ability to stop environment' do
it 'does not allow to stop environment' do
- expect(page).to have_no_link('Stop')
+ expect(page).not_to have_button('Stop')
end
end
@@ -182,7 +183,7 @@ describe 'Environment' do
let(:role) { :reporter }
it 'does not show stop button' do
- expect(page).not_to have_link('Stop')
+ expect(page).not_to have_button('Stop')
end
end
end
@@ -192,7 +193,7 @@ describe 'Environment' do
let(:environment) { create(:environment, project: project, state: :stopped) }
it 'does not show stop button' do
- expect(page).not_to have_link('Stop')
+ expect(page).not_to have_button('Stop')
end
end
end
@@ -230,7 +231,7 @@ describe 'Environment' do
it 'user visits environment page' do
visit_environment(environment)
- expect(page).to have_link('Stop')
+ expect(page).to have_button('Stop')
end
it 'user deletes the branch with running environment' do
@@ -242,7 +243,7 @@ describe 'Environment' do
visit_environment(environment)
- expect(page).to have_no_link('Stop')
+ expect(page).not_to have_button('Stop')
end
##
diff --git a/spec/features/projects/environments/environments_spec.rb b/spec/features/projects/environments/environments_spec.rb
index 9900c13095e..f0890018286 100644
--- a/spec/features/projects/environments/environments_spec.rb
+++ b/spec/features/projects/environments/environments_spec.rb
@@ -10,6 +10,10 @@ describe 'Environments page', :js do
sign_in(user)
end
+ def stop_button_selector
+ %q{button[data-original-title="Stop environment"]}
+ end
+
describe 'page tabs' do
it 'shows "Available" and "Stopped" tab with links' do
visit_environments(project)
@@ -120,7 +124,7 @@ describe 'Environments page', :js do
end
it 'does not show stip button when environment is not stoppable' do
- expect(page).not_to have_selector('.stop-env-link')
+ expect(page).not_to have_selector(stop_button_selector)
end
end
@@ -178,7 +182,7 @@ describe 'Environments page', :js do
end
it 'shows a stop button' do
- expect(page).not_to have_selector('.stop-env-link')
+ expect(page).not_to have_selector(stop_button_selector)
end
it 'does not show external link button' do
@@ -211,22 +215,22 @@ describe 'Environments page', :js do
end
it 'shows a stop button' do
- expect(page).to have_selector('.stop-env-link')
+ expect(page).to have_selector(stop_button_selector)
end
context 'when user is a reporter' do
let(:role) { :reporter }
it 'does not show stop button' do
- expect(page).not_to have_selector('.stop-env-link')
+ expect(page).not_to have_selector(stop_button_selector)
end
end
end
context 'when kubernetes terminal is available' do
shared_examples 'same behavior between KubernetesService and Platform::Kubernetes' do
- context 'for project master' do
- let(:role) { :master }
+ context 'for project maintainer' do
+ let(:role) { :maintainer }
it 'shows the terminal button' do
expect(page).to have_terminal_button