diff options
Diffstat (limited to 'test/pleroma/web/common_api')
-rw-r--r-- | test/pleroma/web/common_api/utils_test.exs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/pleroma/web/common_api/utils_test.exs b/test/pleroma/web/common_api/utils_test.exs index d8fec3520..a12332cad 100644 --- a/test/pleroma/web/common_api/utils_test.exs +++ b/test/pleroma/web/common_api/utils_test.exs @@ -655,6 +655,16 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do assert Utils.attachments_from_ids(%{media_ids: ["#{object.id}"]}) == [object.data] end + test "returns attachment object with raw URL" do + assert Utils.attachments_from_ids(%{media_ids: ["https://example.org/corndog.jpeg"]}) == [ + %{ + "name" => nil, + "type" => "Document", + "url" => [%{"href" => "https://example.org/corndog.jpeg", "type" => "Link"}] + } + ] + end + test "returns [] when not pass media_ids" do assert Utils.attachments_from_ids(%{}) == [] end |