mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-13 15:58:50 +00:00
Add optional OAuth application to reports (#30539)
This commit is contained in:
@@ -36,6 +36,7 @@ RSpec.describe ActivityPub::Activity::Flag do
|
||||
expect(report).to_not be_nil
|
||||
expect(report.comment).to eq 'Boo!!'
|
||||
expect(report.status_ids).to eq [status.id]
|
||||
expect(report.application).to be_nil
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@ RSpec.describe 'Reports' do
|
||||
|
||||
expect(target_account.targeted_reports).to_not be_empty
|
||||
expect(target_account.targeted_reports.first.comment).to eq 'reasons'
|
||||
expect(target_account.targeted_reports.first.application).to eq token.application
|
||||
|
||||
expect(emails.size)
|
||||
.to eq(1)
|
||||
|
||||
@@ -23,6 +23,11 @@ RSpec.describe ReportService do
|
||||
stub_request(:post, 'http://example.com/inbox').to_return(status: 200)
|
||||
end
|
||||
|
||||
it 'does not have an application' do
|
||||
report = subject.call(source_account, remote_account)
|
||||
expect(report.application).to be_nil
|
||||
end
|
||||
|
||||
context 'when forward is true', :inline_jobs do
|
||||
let(:forward) { true }
|
||||
|
||||
@@ -96,6 +101,15 @@ RSpec.describe ReportService do
|
||||
end
|
||||
end
|
||||
|
||||
context 'when passed an application' do
|
||||
let(:application) { Fabricate(:application) }
|
||||
|
||||
it 'has an application' do
|
||||
report = subject.call(source_account, target_account, application: application)
|
||||
expect(report.application).to eq application
|
||||
end
|
||||
end
|
||||
|
||||
context 'when the reported status is a DM' do
|
||||
subject do
|
||||
-> { described_class.new.call(source_account, target_account, status_ids: [status.id]) }
|
||||
|
||||
Reference in New Issue
Block a user