about summary refs log tree commit diff
path: root/spec/services/activitypub
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-06-27 16:43:55 +0200
committerGitHub <noreply@github.com>2019-06-27 16:43:55 +0200
commit2f95adc06fbfae22e8f9b4df212938108f5e295c (patch)
tree13ff1b5ae743f3d147eb58dfa4a790ef1a7c049d /spec/services/activitypub
parent9ef25877dfda12cf31ec586294e4d4908f5be4f0 (diff)
parent6ab7051b48dcb1d45c377a129350db1fdeaf11b8 (diff)
Merge pull request #1142 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'spec/services/activitypub')
-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
         {