mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Destroy invites of anonymized emails (#13404)
Anonymizing a user changed their email address, destroyed all associated InvitedUser records, but did not destroy the invites associated to user's email.
This commit is contained in:
@@ -368,4 +368,17 @@ describe UserAnonymizer do
|
||||
|
||||
end
|
||||
|
||||
describe "anonymize_emails" do
|
||||
it "destroys all associated invites" do
|
||||
invite = Fabricate(:invite, email: 'test@example.com')
|
||||
user = invite.redeem
|
||||
|
||||
Jobs.run_immediately!
|
||||
described_class.make_anonymous(user, admin)
|
||||
|
||||
expect(user.email).not_to eq('test@example.com')
|
||||
expect(Invite.exists?(id: invite.id)).to eq(false)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user