0
0
Fork 0

Add missing action logging to api/v1/admin/reports#update (#29044)

This commit is contained in:
Matt Jankowski 2024-02-06 06:34:11 -05:00 committed by GitHub
parent a31427a629
commit 4cf07ed78c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 32 additions and 5 deletions

View file

@ -58,6 +58,7 @@ describe Admin::ReportsController do
report.reload
expect(report.action_taken_by_account).to eq user.account
expect(report.action_taken?).to be true
expect(last_action_log.target).to eq(report)
end
end
@ -70,6 +71,7 @@ describe Admin::ReportsController do
report.reload
expect(report.action_taken_by_account).to be_nil
expect(report.action_taken?).to be false
expect(last_action_log.target).to eq(report)
end
end
@ -81,6 +83,7 @@ describe Admin::ReportsController do
expect(response).to redirect_to(admin_report_path(report))
report.reload
expect(report.assigned_account).to eq user.account
expect(last_action_log.target).to eq(report)
end
end
@ -92,6 +95,13 @@ describe Admin::ReportsController do
expect(response).to redirect_to(admin_report_path(report))
report.reload
expect(report.assigned_account).to be_nil
expect(last_action_log.target).to eq(report)
end
end
private
def last_action_log
Admin::ActionLog.last
end
end