profile emojis in User.emoji instead of source_data

This commit is contained in:
Haelwenn (lanodan) Monnier 2020-04-03 13:03:32 +02:00
commit 9172d719cc
No known key found for this signature in database
GPG key ID: D5B7A8E43C997DEE
20 changed files with 103 additions and 158 deletions

View file

@ -2182,4 +2182,18 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
Transmogrifier.set_replies(object.data)["replies"]
end
end
test "take_emoji_tags/1" do
user = insert(:user, %{emoji: %{"firefox" => "https://example.org/firefox.png"}})
assert Transmogrifier.take_emoji_tags(user) == [
%{
"icon" => %{"type" => "Image", "url" => "https://example.org/firefox.png"},
"id" => "https://example.org/firefox.png",
"name" => ":firefox:",
"type" => "Emoji",
"updated" => "1970-01-01T00:00:00Z"
}
]
end
end

View file

@ -38,7 +38,7 @@ defmodule Pleroma.Web.ActivityPub.UserViewTest do
end
test "Renders with emoji tags" do
user = insert(:user, emoji: [%{"bib" => "/test"}])
user = insert(:user, emoji: %{"bib" => "/test"})
assert %{
"tag" => [