diff options
author | Timothy Andrew <mail@timothyandrew.net> | 2017-04-05 22:25:52 +0530 |
---|---|---|
committer | Timothy Andrew <mail@timothyandrew.net> | 2017-04-06 18:59:16 +0530 |
commit | 682987547a932c011f84c6455f0fd32bb500b308 (patch) | |
tree | ec4893891fe79bb721931948ca778613bd665e6a /spec/services/users | |
parent | 6a065074a3add27825631451dd478d1164c1a1cd (diff) | |
download | gitlab-ce-682987547a932c011f84c6455f0fd32bb500b308.tar.gz |
Move a user's abuse reports to the ghost user
... when the user is destroyed.
To clarify, this regards abuse reports that the to-be-deleted user has _reported_.
Diffstat (limited to 'spec/services/users')
-rw-r--r-- | spec/services/users/destroy_service_spec.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/services/users/destroy_service_spec.rb b/spec/services/users/destroy_service_spec.rb index 3efa7c196dc..028de62e4ca 100644 --- a/spec/services/users/destroy_service_spec.rb +++ b/spec/services/users/destroy_service_spec.rb @@ -162,6 +162,13 @@ describe Users::DestroyService, services: true do let(:created_record) { create(:note, project: project, author: user) } end end + + context 'abuse reports' do + include_examples "migrating a deleted user's associated records to the ghost user", AbuseReport, { skip_assignee_specs: true } do + let(:created_record) { create(:abuse_report, reporter: user, user: create(:user)) } + let(:author_method) { :reporter } + end + end end end end |