From a2bceaf688608f61151e298e6025ccbecc9de227 Mon Sep 17 00:00:00 2001
From: William Pitcock <nenolod@dereferenced.org>
Date: Sun, 23 Dec 2018 13:59:06 +0000
Subject: [PATCH] tests: twitter api: add test proving that peertube videos are
 correctly handled

---
 test/web/twitter_api/views/activity_view_test.exs | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/test/web/twitter_api/views/activity_view_test.exs b/test/web/twitter_api/views/activity_view_test.exs
index 09d7a18d4..fd511b546 100644
--- a/test/web/twitter_api/views/activity_view_test.exs
+++ b/test/web/twitter_api/views/activity_view_test.exs
@@ -265,4 +265,18 @@ test "a delete activity" do
 
     assert result == expected
   end
+
+  test "a peertube video" do
+    {:ok, object} =
+      ActivityPub.fetch_object_from_id(
+        "https://peertube.moe/videos/watch/df5f464b-be8d-46fb-ad81-2d4c2d1630e3"
+      )
+
+    %Activity{} = activity = Activity.get_create_activity_by_object_ap_id(object.data["id"])
+
+    result = ActivityView.render("activity.json", activity: activity)
+
+    assert length(result["attachments"]) == 1
+    assert result["summary"] == "Friday Night"
+  end
 end