tests: twitter api: add test proving that peertube videos are correctly handled
authorWilliam Pitcock <nenolod@dereferenced.org>
Sun, 23 Dec 2018 13:59:06 +0000 (13:59 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Sun, 23 Dec 2018 14:00:54 +0000 (14:00 +0000)
test/web/twitter_api/views/activity_view_test.exs

index 09d7a18d44dc984fecccb65c11a76c11077e369f..fd511b5462fc97c9252d4d028e01968a1c6dbfa8 100644 (file)
@@ -265,4 +265,18 @@ defmodule Pleroma.Web.TwitterAPI.ActivityViewTest 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