summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2018-08-16 15:29:05 +0000
committerNick Thomas <nick@gitlab.com>2018-08-16 15:29:05 +0000
commit7e508fba7d0fcca8c448aff57d3be06f8288ccf6 (patch)
tree9af3a05c4bd6acaf0d02501340b9ab1f8819a691 /spec
parent9939b613d41a88cdebec9711980e4c9a84c50693 (diff)
parent5fbb6ddf23da52cf68ed4f87137debfb6f30f6e8 (diff)
downloadgitlab-ce-7e508fba7d0fcca8c448aff57d3be06f8288ccf6.tar.gz
Merge branch '49796-project-deletion-may-not-log-audit-events-during-group-deletion' into 'master'
Resolve "Project deletion may not log audit events during group deletion" Closes #49796 See merge request gitlab-org/gitlab-ce!21162
Diffstat (limited to 'spec')
-rw-r--r--spec/services/groups/destroy_service_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/services/groups/destroy_service_spec.rb b/spec/services/groups/destroy_service_spec.rb
index b54491cf5f9..d80d0f5a8a8 100644
--- a/spec/services/groups/destroy_service_spec.rb
+++ b/spec/services/groups/destroy_service_spec.rb
@@ -135,6 +135,17 @@ describe Groups::DestroyService do
it_behaves_like 'group destruction', false
end
+ context 'repository removal status is taken into account' do
+ it 'raises exception' do
+ expect_next_instance_of(::Projects::DestroyService) do |destroy_service|
+ expect(destroy_service).to receive(:execute).and_return(false)
+ end
+
+ expect { destroy_group(group, user, false) }
+ .to raise_error(Groups::DestroyService::DestroyError, "Project #{project.id} can't be deleted" )
+ end
+ end
+
describe 'repository removal' do
before do
destroy_group(group, user, false)