mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: remove all invites
https://meta.discourse.org/t/remove-all-invitations-button-for-the-admin-panel/65207
This commit is contained in:
@@ -484,4 +484,16 @@ describe Invite do
|
||||
|
||||
end
|
||||
|
||||
describe '.rescind_all_invites_from' do
|
||||
it 'removes all invites sent by a user' do
|
||||
user = Fabricate(:user)
|
||||
invite_1 = Fabricate(:invite, invited_by: user)
|
||||
invite_2 = Fabricate(:invite, invited_by: user)
|
||||
Invite.rescind_all_invites_from(user)
|
||||
invite_1.reload
|
||||
invite_2.reload
|
||||
expect(invite_1.deleted_at).to be_present
|
||||
expect(invite_2.deleted_at).to be_present
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user