mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
UX: when admin is deleted, make it clear in staff action logs when records belong to a deleted user and show their username in the details
This commit is contained in:
@@ -360,6 +360,28 @@ describe UserDestroyer do
|
||||
}.to change { User.count }.by(-1)
|
||||
end
|
||||
end
|
||||
|
||||
context 'user has staff action logs' do
|
||||
before do
|
||||
logger = StaffActionLogger.new(user)
|
||||
logger.log_site_setting_change(
|
||||
'site_description',
|
||||
'Our friendly community',
|
||||
'My favourite community'
|
||||
)
|
||||
end
|
||||
|
||||
it "should keep the staff action log and add the username" do
|
||||
username = user.username
|
||||
log = UserHistory.staff_action_records(
|
||||
Discourse.system_user,
|
||||
acting_user: username
|
||||
).to_a[0]
|
||||
UserDestroyer.new(admin).destroy(user, delete_posts: true)
|
||||
log.reload
|
||||
expect(log.details).to include(username)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user