Merge commit '4a22e72b9b1b8f14792efcc649b0db8bc27f0df2' into glitch-soc/merge-upstream
This commit is contained in:
		@@ -39,6 +39,37 @@ RSpec.describe ActivityPub::Activity::Flag do
 | 
			
		||||
      end
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    context 'when the report comment is excessively long' do
 | 
			
		||||
      subject do
 | 
			
		||||
        described_class.new({
 | 
			
		||||
          '@context': 'https://www.w3.org/ns/activitystreams',
 | 
			
		||||
          id: flag_id,
 | 
			
		||||
          type: 'Flag',
 | 
			
		||||
          content: long_comment,
 | 
			
		||||
          actor: ActivityPub::TagManager.instance.uri_for(sender),
 | 
			
		||||
          object: [
 | 
			
		||||
            ActivityPub::TagManager.instance.uri_for(flagged),
 | 
			
		||||
            ActivityPub::TagManager.instance.uri_for(status),
 | 
			
		||||
          ],
 | 
			
		||||
        }.with_indifferent_access, sender)
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      let(:long_comment) { Faker::Lorem.characters(number: 6000) }
 | 
			
		||||
 | 
			
		||||
      before do
 | 
			
		||||
        subject.perform
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      it 'creates a report but with a truncated comment' do
 | 
			
		||||
        report = Report.find_by(account: sender, target_account: flagged)
 | 
			
		||||
 | 
			
		||||
        expect(report).to_not be_nil
 | 
			
		||||
        expect(report.comment.length).to eq 5000
 | 
			
		||||
        expect(report.comment).to eq long_comment[0...5000]
 | 
			
		||||
        expect(report.status_ids).to eq [status.id]
 | 
			
		||||
      end
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    context 'when the reported status is private and should not be visible to the remote server' do
 | 
			
		||||
      let(:status) { Fabricate(:status, account: flagged, uri: 'foobar', visibility: :private) }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user