Merge remote-tracking branch 'parent/main' into upstream-20241006

This commit is contained in:
KMY 2024-10-05 09:10:58 +09:00
commit 66bed31dbe
226 changed files with 2688 additions and 1846 deletions

View file

@ -31,14 +31,13 @@ RSpec.describe ReportService do
context 'when forward is true', :inline_jobs do
let(:forward) { true }
it 'sends ActivityPub payload when forward is true' do
subject.call(source_account, remote_account, forward: forward)
expect(a_request(:post, 'http://example.com/inbox')).to have_been_made
end
it 'has an uri' do
it 'has a URI and sends ActivityPub payload' do
report = subject.call(source_account, remote_account, forward: forward)
expect(report.uri).to_not be_nil
expect(report.uri)
.to_not be_nil
expect(a_request(:post, 'http://example.com/inbox'))
.to have_been_made
end
context 'when reporting a reply on a different remote server' do
@ -122,13 +121,12 @@ RSpec.describe ReportService do
status.mentions.create(account: source_account)
end
it 'creates a report' do
expect { subject.call }.to change { target_account.targeted_reports.count }.from(0).to(1)
end
it 'creates a report and attaches the DM to the report' do
expect { subject.call }
.to change { target_account.targeted_reports.count }.from(0).to(1)
it 'attaches the DM to the report' do
subject.call
expect(target_account.targeted_reports.pluck(:status_ids)).to eq [[status.id]]
expect(target_account.targeted_reports.pluck(:status_ids))
.to eq [[status.id]]
end
end
@ -146,13 +144,12 @@ RSpec.describe ReportService do
status.mentions.create(account: source_account)
end
it 'creates a report' do
expect { subject.call }.to change { target_account.targeted_reports.count }.from(0).to(1)
end
it 'creates a report and attaches DM to report' do
expect { subject.call }
.to change { target_account.targeted_reports.count }.from(0).to(1)
it 'attaches the DM to the report' do
subject.call
expect(target_account.targeted_reports.pluck(:status_ids)).to eq [[status.id]]
expect(target_account.targeted_reports.pluck(:status_ids))
.to eq [[status.id]]
end
end