Allow reports with long comments from remote instances, but truncate (#25028)
This commit is contained in:
		@@ -6,6 +6,14 @@ RSpec.describe ReportService, type: :service do
 | 
			
		||||
  subject { described_class.new }
 | 
			
		||||
 | 
			
		||||
  let(:source_account) { Fabricate(:account) }
 | 
			
		||||
  let(:target_account) { Fabricate(:account) }
 | 
			
		||||
 | 
			
		||||
  context 'with a local account' do
 | 
			
		||||
    it 'has a uri' do
 | 
			
		||||
      report = subject.call(source_account, target_account)
 | 
			
		||||
      expect(report.uri).to_not be_nil
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  context 'with a remote account' do
 | 
			
		||||
    let(:remote_account) { Fabricate(:account, domain: 'example.com', protocol: :activitypub, inbox_url: 'http://example.com/inbox') }
 | 
			
		||||
@@ -35,7 +43,6 @@ RSpec.describe ReportService, type: :service do
 | 
			
		||||
      -> { described_class.new.call(source_account, target_account, status_ids: [status.id]) }
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    let(:target_account) { Fabricate(:account) }
 | 
			
		||||
    let(:status) { Fabricate(:status, account: target_account, visibility: :direct) }
 | 
			
		||||
 | 
			
		||||
    context 'when it is addressed to the reporter' do
 | 
			
		||||
@@ -91,8 +98,7 @@ RSpec.describe ReportService, type: :service do
 | 
			
		||||
      -> {  described_class.new.call(source_account, target_account) }
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    let!(:target_account) { Fabricate(:account) }
 | 
			
		||||
    let!(:other_report)   { Fabricate(:report, target_account: target_account) }
 | 
			
		||||
    let!(:other_report) { Fabricate(:report, target_account: target_account) }
 | 
			
		||||
 | 
			
		||||
    before do
 | 
			
		||||
      ActionMailer::Base.deliveries.clear
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user