X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=test%2Fpleroma%2Fweb%2Factivity_pub%2Ftransmogrifier_test.exs;h=a7894a8d0ff8e1a2d39969b58485ef7267173778;hb=3bc7d122712b5cc35ba509542bde63ca130d6a40;hp=66ea7664aff340a9135158e9cc9be64e853ded31;hpb=31c89acd00396f95a35ea325ed848ffeb2826017;p=akkoma diff --git a/test/pleroma/web/activity_pub/transmogrifier_test.exs b/test/pleroma/web/activity_pub/transmogrifier_test.exs index 66ea7664a..a7894a8d0 100644 --- a/test/pleroma/web/activity_pub/transmogrifier_test.exs +++ b/test/pleroma/web/activity_pub/transmogrifier_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2020 Pleroma Authors +# Copyright © 2017-2021 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do @@ -56,7 +56,7 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do other_user = insert(:user) {:ok, activity} = CommonAPI.post(user, %{status: "test post"}) - object = Object.normalize(activity) + object = Object.normalize(activity, fetch: false) note_obj = %{ "type" => "Note", @@ -153,15 +153,6 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do end end - test "it adds the sensitive property" do - user = insert(:user) - - {:ok, activity} = CommonAPI.post(user, %{status: "#nsfw hey"}) - {:ok, modified} = Transmogrifier.prepare_outgoing(activity.data) - - assert modified["object"]["sensitive"] - end - test "it adds the json-ld context and the conversation property" do user = insert(:user) @@ -281,6 +272,21 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do {:ok, _modified} = Transmogrifier.prepare_outgoing(activity.data) end + + test "custom emoji urls are URI encoded" do + # :dinosaur: filename has a space -> dino walking.gif + user = insert(:user) + + {:ok, activity} = CommonAPI.post(user, %{status: "everybody do the dinosaur :dinosaur:"}) + + {:ok, prepared} = Transmogrifier.prepare_outgoing(activity.data) + + assert length(prepared["object"]["tag"]) == 1 + + url = prepared["object"]["tag"] |> List.first() |> Map.get("icon") |> Map.get("url") + + assert url == "http://localhost:4001/emoji/dino%20walking.gif" + end end describe "user upgrade" do