about summary refs log tree commit diff
path: root/spec/lib/activitypub
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2020-05-15 17:08:59 +0200
committerGitHub <noreply@github.com>2020-05-15 17:08:59 +0200
commita319c1e60f5ef125474122da6deb3b3251f7f0ef (patch)
treeefe7d1220b6fc468f66433abb88de3197617f5a3 /spec/lib/activitypub
parent328c5a21d7c4a1641d25f1d01b043f39e9809926 (diff)
Add support for `summary` field for media description (#13763)
Diffstat (limited to 'spec/lib/activitypub')
-rw-r--r--spec/lib/activitypub/activity/create_spec.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/lib/activitypub/activity/create_spec.rb b/spec/lib/activitypub/activity/create_spec.rb
index c4efb5cc9..5220deabb 100644
--- a/spec/lib/activitypub/activity/create_spec.rb
+++ b/spec/lib/activitypub/activity/create_spec.rb
@@ -287,6 +287,31 @@ RSpec.describe ActivityPub::Activity::Create do
         end
       end
 
+      context 'with media attachments with long description as summary' do
+        let(:object_json) do
+          {
+            id: [ActivityPub::TagManager.instance.uri_for(sender), '#bar'].join,
+            type: 'Note',
+            content: 'Lorem ipsum',
+            attachment: [
+              {
+                type: 'Document',
+                mediaType: 'image/png',
+                url: 'http://example.com/attachment.png',
+                summary: '*' * 1500,
+              },
+            ],
+          }
+        end
+
+        it 'creates status' do
+          status = sender.statuses.first
+
+          expect(status).to_not be_nil
+          expect(status.media_attachments.map(&:description)).to include('*' * 1500)
+        end
+      end
+
       context 'with media attachments with focal points' do
         let(:object_json) do
           {