diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-04 03:08:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-04 03:08:51 +0300 |
commit | 099deb2725d99f655ad831c3122b5632bb37f9d2 (patch) | |
tree | 4189e13b0390fa016f2b65b04572093428ca4530 /spec/features | |
parent | 4bf395cded929b1f2d2419079d8107604c9f930f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/projects/pipelines/pipeline_spec.rb | 46 |
1 files changed, 15 insertions, 31 deletions
diff --git a/spec/features/projects/pipelines/pipeline_spec.rb b/spec/features/projects/pipelines/pipeline_spec.rb index ce2083b397a..ee1ff550697 100644 --- a/spec/features/projects/pipelines/pipeline_spec.rb +++ b/spec/features/projects/pipelines/pipeline_spec.rb @@ -437,44 +437,28 @@ RSpec.describe 'Pipeline', :js do end end - shared_context 'delete pipeline' do - context 'deleting pipeline' do - context 'when user can not delete' do - before do - visit_pipeline - end - - it { expect(page).not_to have_button('Delete') } - end - - context 'when deleting' do - before do - group.add_owner(user) - - visit_pipeline - - click_button 'Delete' - click_button 'Delete pipeline' - end - - it 'redirects to pipeline overview page', :sidekiq_inline do - expect(page).to have_content('The pipeline has been deleted') - expect(current_path).to eq(project_pipelines_path(project)) - end - end + context 'when user can not delete' do + before do + visit_pipeline end - end - context 'when cancel_pipelines_prior_to_destroy is enabled' do - include_context 'delete pipeline' + it { expect(page).not_to have_button('Delete') } end - context 'when cancel_pipelines_prior_to_destroy is disabled' do + context 'when deleting' do before do - stub_feature_flags(cancel_pipelines_prior_to_destroy: false) + group.add_owner(user) + + visit_pipeline + + click_button 'Delete' + click_button 'Delete pipeline' end - include_context 'delete pipeline' + it 'redirects to pipeline overview page', :sidekiq_inline do + expect(page).to have_content('The pipeline has been deleted') + expect(current_path).to eq(project_pipelines_path(project)) + end end context 'when pipeline ref does not exist in repository anymore' do |