about summary refs log tree commit diff
path: root/spec/services/activitypub/fetch_remote_status_service_spec.rb
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-06-26 19:32:36 +0200
committerEugen Rochko <eugen@zeonfederated.com>2019-06-26 19:32:36 +0200
commit915c619394165a114a4ab316165aecac3386cf2f (patch)
tree56ee4eb360be9b4ac1a89f7223363f67ec46d3e8 /spec/services/activitypub/fetch_remote_status_service_spec.rb
parent32a44949265e9f0d64b5f94597631385ca17b414 (diff)
Add support for Audio activities (#11189)
Fixes #11127
Diffstat (limited to 'spec/services/activitypub/fetch_remote_status_service_spec.rb')
-rw-r--r--spec/services/activitypub/fetch_remote_status_service_spec.rb33
1 files changed, 33 insertions, 0 deletions
diff --git a/spec/services/activitypub/fetch_remote_status_service_spec.rb b/spec/services/activitypub/fetch_remote_status_service_spec.rb
index 9ae409996..78dd59e3b 100644
--- a/spec/services/activitypub/fetch_remote_status_service_spec.rb
+++ b/spec/services/activitypub/fetch_remote_status_service_spec.rb
@@ -71,6 +71,39 @@ RSpec.describe ActivityPub::FetchRemoteStatusService, type: :service do
       end
     end
 
+    context 'with Audio object' do
+      let(:object) do
+        {
+          '@context': 'https://www.w3.org/ns/activitystreams',
+          id: "https://#{valid_domain}/@foo/1234",
+          type: 'Audio',
+          name: 'Nyan Cat 10 hours remix',
+          attributedTo: ActivityPub::TagManager.instance.uri_for(sender),
+          url: [
+            {
+              type: 'Link',
+              mimeType: 'application/x-bittorrent',
+              href: "https://#{valid_domain}/12345.torrent",
+            },
+
+            {
+              type: 'Link',
+              mimeType: 'text/html',
+              href: "https://#{valid_domain}/watch?v=12345",
+            },
+          ],
+        }
+      end
+
+      it 'creates status' do
+        status = sender.statuses.first
+
+        expect(status).to_not be_nil
+        expect(status.url).to eq "https://#{valid_domain}/watch?v=12345"
+        expect(strip_tags(status.text)).to eq "Nyan Cat 10 hours remix https://#{valid_domain}/watch?v=12345"
+      end
+    end
+
     context 'with wrong id' do
       let(:note) do
         {