Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-03-23 03:09:09 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-03-23 03:09:09 +0300
commit5df6990daccf98d24f3ac45865d0386c3a4c3eb5 (patch)
treec2d2f2d59012d1dee0fadfdf6d321e0db23cbb9e /spec/services/projects
parentb489f0f0a1ebcea2044911b7b38837f072b7ee05 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services/projects')
-rw-r--r--spec/services/projects/destroy_service_spec.rb22
1 files changed, 19 insertions, 3 deletions
diff --git a/spec/services/projects/destroy_service_spec.rb b/spec/services/projects/destroy_service_spec.rb
index 5410e784cc0..6debef81659 100644
--- a/spec/services/projects/destroy_service_spec.rb
+++ b/spec/services/projects/destroy_service_spec.rb
@@ -93,10 +93,26 @@ RSpec.describe Projects::DestroyService, :aggregate_failures do
destroy_project(project, user, {})
end
- it 'performs cancel for project ci pipelines' do
- expect(::Ci::AbortProjectPipelinesService).to receive_message_chain(:new, :execute).with(project)
+ context 'with abort_deleted_project_pipelines feature disabled' do
+ it 'does not cancel project ci pipelines' do
+ stub_feature_flags(abort_deleted_project_pipelines: false)
- destroy_project(project, user, {})
+ expect(::Ci::AbortPipelinesService).not_to receive(:new)
+
+ destroy_project(project, user, {})
+ end
+ end
+
+ context 'with abort_deleted_project_pipelines feature enabled' do
+ it 'performs cancel for project ci pipelines' do
+ stub_feature_flags(abort_deleted_project_pipelines: true)
+ pipelines = build_list(:ci_pipeline, 3, :running)
+ allow(project).to receive(:all_pipelines).and_return(pipelines)
+
+ expect(::Ci::AbortPipelinesService).to receive_message_chain(:new, :execute).with(pipelines)
+
+ destroy_project(project, user, {})
+ end
end
context 'when project has remote mirrors' do