diff options
author | Stan Hu <stanhu@gmail.com> | 2018-09-19 05:37:02 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-09-19 06:36:29 -0700 |
commit | 311beef242ae4fc3dd666542ca01938fb9d0e15d (patch) | |
tree | 4dcaf0d71384b5b0c856c74145d846a606be4f76 /spec | |
parent | a1912ccc894386b112faba2932f1dd98c03aea0e (diff) | |
download | gitlab-ce-311beef242ae4fc3dd666542ca01938fb9d0e15d.tar.gz |
Move registry destroy out of project transaction
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/container_registry_spec.rb | 2 | ||||
-rw-r--r-- | spec/services/projects/container_repository/destroy_service_spec.rb | 2 | ||||
-rw-r--r-- | spec/services/projects/destroy_service_spec.rb | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/spec/features/container_registry_spec.rb b/spec/features/container_registry_spec.rb index 0dddf6d3ec5..9986206f619 100644 --- a/spec/features/container_registry_spec.rb +++ b/spec/features/container_registry_spec.rb @@ -39,7 +39,7 @@ describe "Container Registry", :js do visit_container_registry expect_any_instance_of(ContainerRepository) - .to receive(:delete_tags!).twice.and_return(true) + .to receive(:delete_tags!).and_return(true) click_on(class: 'js-remove-repo') end diff --git a/spec/services/projects/container_repository/destroy_service_spec.rb b/spec/services/projects/container_repository/destroy_service_spec.rb index af54e1b15e3..affcc66d2bb 100644 --- a/spec/services/projects/container_repository/destroy_service_spec.rb +++ b/spec/services/projects/container_repository/destroy_service_spec.rb @@ -33,7 +33,7 @@ describe Projects::ContainerRepository::DestroyService do end it 'deletes the repository' do - expect(repository).to receive(:delete_tags!).twice.and_call_original + 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 |