Add in-app notifications for moderation actions/warnings (#30065)
This commit is contained in:
parent
0ec061aa8f
commit
4ef0b48b95
13 changed files with 188 additions and 21 deletions
|
@ -69,22 +69,22 @@ RSpec.describe Admin::AccountAction do
|
|||
end
|
||||
end
|
||||
|
||||
it 'creates Admin::ActionLog' do
|
||||
it 'sends notification, log the action, and closes other reports', :aggregate_failures do
|
||||
other_report = Fabricate(:report, target_account: target_account)
|
||||
|
||||
emails = []
|
||||
expect do
|
||||
subject
|
||||
end.to change(Admin::ActionLog, :count).by 1
|
||||
end
|
||||
emails = capture_emails { subject }
|
||||
end.to (change(Admin::ActionLog.where(action: type), :count).by 1)
|
||||
.and(change { other_report.reload.action_taken? }.from(false).to(true))
|
||||
|
||||
it 'calls process_email!' do
|
||||
allow(account_action).to receive(:process_email!)
|
||||
subject
|
||||
expect(account_action).to have_received(:process_email!)
|
||||
end
|
||||
expect(emails).to contain_exactly(
|
||||
have_attributes(
|
||||
to: contain_exactly(target_account.user.email)
|
||||
)
|
||||
)
|
||||
|
||||
it 'calls process_reports!' do
|
||||
allow(account_action).to receive(:process_reports!)
|
||||
subject
|
||||
expect(account_action).to have_received(:process_reports!)
|
||||
expect(LocalNotificationWorker).to have_enqueued_sidekiq_job(target_account.id, anything, 'AccountWarning', 'moderation_warning')
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue