summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2017-04-16 08:21:40 -0700
committerStan Hu <stanhu@gmail.com>2017-04-16 08:36:33 -0700
commit60eee739f040e997d6dac3f4e21ef90daa6c7f30 (patch)
treead09acc17c462ffeb1337d819dbaf7ba50d2a32e /spec
parent309bab431075eabfb7a01300f946ce9eb5b6fb98 (diff)
downloadgitlab-ce-60eee739f040e997d6dac3f4e21ef90daa6c7f30.tar.gz
Hard delete users' associated records deleted from AbuseReportssh-add-option-to-hard-delete
In the case of spammers, we really want a hard delete to avoid retaining spam. Closes #31021
Diffstat (limited to 'spec')
-rw-r--r--spec/models/abuse_report_spec.rb3
-rw-r--r--spec/services/users/destroy_service_spec.rb6
2 files changed, 8 insertions, 1 deletions
diff --git a/spec/models/abuse_report_spec.rb b/spec/models/abuse_report_spec.rb
index 4e71597521d..ced93c8f762 100644
--- a/spec/models/abuse_report_spec.rb
+++ b/spec/models/abuse_report_spec.rb
@@ -29,7 +29,8 @@ RSpec.describe AbuseReport, type: :model do
it 'lets a worker delete the user' do
expect(DeleteUserWorker).to receive(:perform_async).with(user.id, subject.user.id,
- delete_solo_owned_groups: true)
+ delete_solo_owned_groups: true,
+ hard_delete: true)
subject.remove_user(deleted_by: user)
end
diff --git a/spec/services/users/destroy_service_spec.rb b/spec/services/users/destroy_service_spec.rb
index 43c18992d1a..4bc30018ebd 100644
--- a/spec/services/users/destroy_service_spec.rb
+++ b/spec/services/users/destroy_service_spec.rb
@@ -152,6 +152,12 @@ describe Users::DestroyService, services: true do
service.execute(user)
end
+
+ it 'does not run `MigrateToGhostUser` if hard_delete option is given' do
+ expect_any_instance_of(Users::MigrateToGhostUserService).not_to receive(:execute)
+
+ service.execute(user, hard_delete: true)
+ end
end
end
end