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
path: root/spec
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2018-09-20 01:03:11 +0300
committerRobert Speicher <robert@gitlab.com>2018-09-20 01:03:11 +0300
commite7df8070b23b5c417ac7e835a470fda719cb51fc (patch)
treee430344db9296df533ac7b8d427da603407f60f0 /spec
parent3f51ec2124037177b446d620c41441673f17f161 (diff)
parent311beef242ae4fc3dd666542ca01938fb9d0e15d (diff)
Merge branch 'sh-delete-tags-outside-transaction' into 'master'
Delete container repository tags outside of transaction Closes #51380 See merge request gitlab-org/gitlab-ce!21679
Diffstat (limited to 'spec')
-rw-r--r--spec/services/projects/container_repository/destroy_service_spec.rb1
-rw-r--r--spec/services/projects/destroy_service_spec.rb2
2 files changed, 2 insertions, 1 deletions
diff --git a/spec/services/projects/container_repository/destroy_service_spec.rb b/spec/services/projects/container_repository/destroy_service_spec.rb
index 307ccc88865..affcc66d2bb 100644
--- a/spec/services/projects/container_repository/destroy_service_spec.rb
+++ b/spec/services/projects/container_repository/destroy_service_spec.rb
@@ -33,6 +33,7 @@ describe Projects::ContainerRepository::DestroyService do
end
it 'deletes the repository' do
+ expect(repository).to receive(:delete_tags!).and_call_original
expect { described_class.new(project, user).execute(repository) }.to change { ContainerRepository.all.count }.by(-1)
end
end
diff --git a/spec/services/projects/destroy_service_spec.rb b/spec/services/projects/destroy_service_spec.rb
index e428808ab68..beff499f2be 100644
--- a/spec/services/projects/destroy_service_spec.rb
+++ b/spec/services/projects/destroy_service_spec.rb
@@ -204,7 +204,7 @@ describe Projects::DestroyService do
context 'when image repository deletion fails' do
it 'raises an exception' do
expect_any_instance_of(ContainerRepository)
- .to receive(:delete_tags!).and_return(false)
+ .to receive(:delete_tags!).and_raise(RuntimeError)
expect(destroy_project(project, user)).to be false
end