diff options
author | lain <lain@soykaf.club> | 2020-07-07 09:14:50 +0000 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-07-07 09:14:50 +0000 |
commit | 9ad305209aabd8619a397060f979c1f4e735def3 (patch) | |
tree | dfa37cb5a9d1f27c13559221a6af1c57201fc9dc /test/web | |
parent | fa0fa4552f186d03abb59aba22d3f4eac1654e1e (diff) | |
parent | fbb9743a7058e8a7ace69804b79eb032e03da078 (diff) | |
download | pleroma-9ad305209aabd8619a397060f979c1f4e735def3.tar.gz pleroma-9ad305209aabd8619a397060f979c1f4e735def3.zip |
Merge branch 'bugfix/peertube-videos' into 'develop'
Fix getting videos from peertube
See merge request pleroma/pleroma!2728
Diffstat (limited to 'test/web')
-rw-r--r-- | test/web/activity_pub/transmogrifier_test.exs | 48 |
1 files changed, 35 insertions, 13 deletions
diff --git a/test/web/activity_pub/transmogrifier_test.exs b/test/web/activity_pub/transmogrifier_test.exs index 6a53fd3f0..01179206c 100644 --- a/test/web/activity_pub/transmogrifier_test.exs +++ b/test/web/activity_pub/transmogrifier_test.exs @@ -659,22 +659,44 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do "https://peertube.moe/videos/watch/df5f464b-be8d-46fb-ad81-2d4c2d1630e3" ) - attachment = %{ - "type" => "Link", - "mediaType" => "video/mp4", - "url" => [ - %{ - "href" => - "https://peertube.moe/static/webseed/df5f464b-be8d-46fb-ad81-2d4c2d1630e3-480.mp4", - "mediaType" => "video/mp4" - } - ] - } - assert object.data["url"] == "https://peertube.moe/videos/watch/df5f464b-be8d-46fb-ad81-2d4c2d1630e3" - assert object.data["attachment"] == [attachment] + assert object.data["attachment"] == [ + %{ + "type" => "Link", + "mediaType" => "video/mp4", + "url" => [ + %{ + "href" => + "https://peertube.moe/static/webseed/df5f464b-be8d-46fb-ad81-2d4c2d1630e3-480.mp4", + "mediaType" => "video/mp4" + } + ] + } + ] + + {:ok, object} = + Fetcher.fetch_object_from_id( + "https://framatube.org/videos/watch/6050732a-8a7a-43d4-a6cd-809525a1d206" + ) + + assert object.data["attachment"] == [ + %{ + "type" => "Link", + "mediaType" => "video/mp4", + "url" => [ + %{ + "href" => + "https://framatube.org/static/webseed/6050732a-8a7a-43d4-a6cd-809525a1d206-1080.mp4", + "mediaType" => "video/mp4" + } + ] + } + ] + + assert object.data["url"] == + "https://framatube.org/videos/watch/6050732a-8a7a-43d4-a6cd-809525a1d206" end test "it accepts Flag activities" do |