0
0
Fork 0

Fix sort order of moderation notes on Reports and Accounts (#31528)

This commit is contained in:
Emelia Smith 2024-09-06 16:58:36 +02:00 committed by GitHub
parent a9d0b48b65
commit c88ba523ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 105 additions and 8 deletions

View file

@ -55,6 +55,23 @@ RSpec.describe Admin::AccountsController do
describe 'GET #show' do
let(:current_user) { Fabricate(:user, role: UserRole.find_by(name: 'Admin')) }
describe 'account moderation notes' do
let(:account) { Fabricate(:account) }
it 'includes moderation notes' do
note1 = Fabricate(:account_moderation_note, target_account: account)
note2 = Fabricate(:account_moderation_note, target_account: account)
get :show, params: { id: account.id }
expect(response).to have_http_status(200)
moderation_notes = assigns(:moderation_notes).to_a
expect(moderation_notes.size).to be 2
expect(moderation_notes).to eq [note1, note2]
end
end
context 'with a remote account' do
let(:account) { Fabricate(:account, domain: 'example.com') }

View file

@ -47,6 +47,24 @@ RSpec.describe Admin::ReportsController do
expect(response.body)
.to include(report.comment)
end
describe 'account moderation notes' do
let(:report) { Fabricate(:report) }
it 'includes moderation notes' do
note1 = Fabricate(:report_note, report: report)
note2 = Fabricate(:report_note, report: report)
get :show, params: { id: report }
expect(response).to have_http_status(200)
report_notes = assigns(:report_notes).to_a
expect(report_notes.size).to be 2
expect(report_notes).to eq [note1, note2]
end
end
end
describe 'POST #resolve' do