diff options
Diffstat (limited to 'spec/services/projects')
-rw-r--r-- | spec/services/projects/container_repository/destroy_service_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/services/projects/container_repository/destroy_service_spec.rb b/spec/services/projects/container_repository/destroy_service_spec.rb index cc8fd2716e1..753b7540d7f 100644 --- a/spec/services/projects/container_repository/destroy_service_spec.rb +++ b/spec/services/projects/container_repository/destroy_service_spec.rb @@ -36,6 +36,16 @@ describe Projects::ContainerRepository::DestroyService 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 + + context 'when destroy fails' do + it 'set delete_status' do + allow(repository).to receive(:destroy).and_return(false) + + subject.execute(repository) + + expect(repository).to be_delete_failed + end + end end end end |