diff options
Diffstat (limited to 'spec/features/projects/environments/environments_spec.rb')
-rw-r--r-- | spec/features/projects/environments/environments_spec.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/spec/features/projects/environments/environments_spec.rb b/spec/features/projects/environments/environments_spec.rb index 9900c13095e..c2ed753c409 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,14 +215,14 @@ 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 |