diff options
| author | lambda <pleromagit@rogerbraun.net> | 2018-12-23 14:46:58 +0000 |
|---|---|---|
| committer | lambda <pleromagit@rogerbraun.net> | 2018-12-23 14:46:58 +0000 |
| commit | 005b4194ffa855c56b2305d02249b31452155fff (patch) | |
| tree | 25ead7a01d80441b003db2e8954f0b72c95c5650 /test/web/activity_pub | |
| parent | a3e33fa17767ccdc191cfa8a0b9cd602ce07871b (diff) | |
| parent | a2bceaf688608f61151e298e6025ccbecc9de227 (diff) | |
| download | pleroma-005b4194ffa855c56b2305d02249b31452155fff.tar.gz pleroma-005b4194ffa855c56b2305d02249b31452155fff.zip | |
Merge branch 'bugfix/trans_fix_url_videos' into 'develop'
Fix "url" of Videos in transmogrifier
Closes #367
See merge request pleroma/pleroma!459
Diffstat (limited to 'test/web/activity_pub')
| -rw-r--r-- | test/web/activity_pub/transmogrifier_test.exs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/web/activity_pub/transmogrifier_test.exs b/test/web/activity_pub/transmogrifier_test.exs index 0428e052d..6778db390 100644 --- a/test/web/activity_pub/transmogrifier_test.exs +++ b/test/web/activity_pub/transmogrifier_test.exs @@ -684,6 +684,36 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do :error = Transmogrifier.handle_incoming(data) end + + test "it remaps video URLs as attachments if necessary" do + {:ok, object} = + ActivityPub.fetch_object_from_id( + "https://peertube.moe/videos/watch/df5f464b-be8d-46fb-ad81-2d4c2d1630e3" + ) + + attachment = %{ + "type" => "Link", + "mediaType" => "video/mp4", + "href" => + "https://peertube.moe/static/webseed/df5f464b-be8d-46fb-ad81-2d4c2d1630e3-480.mp4", + "mimeType" => "video/mp4", + "size" => 5_015_880, + "url" => [ + %{ + "href" => + "https://peertube.moe/static/webseed/df5f464b-be8d-46fb-ad81-2d4c2d1630e3-480.mp4", + "mediaType" => "video/mp4", + "type" => "Link" + } + ], + "width" => 480 + } + + assert object.data["url"] == + "https://peertube.moe/videos/watch/df5f464b-be8d-46fb-ad81-2d4c2d1630e3" + + assert object.data["attachment"] == [attachment] + end end describe "prepare outgoing" do |
