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

@ -97,18 +97,6 @@ defmodule Pleroma.Web.CommonAPITest do
assert Object.normalize(activity).data["emoji"]["firefox"]
end
test "it adds emoji when updating profiles" do
user = insert(:user, %{name: ":firefox:"})
{:ok, activity} = CommonAPI.update(user)
user = User.get_cached_by_ap_id(user.ap_id)
[firefox] = user.source_data["tag"]
assert firefox["name"] == ":firefox:"
assert Pleroma.Constants.as_public() in activity.recipients
end
describe "posting" do
test "it supports explicit addressing" do
user = insert(:user)

View file

@ -7,7 +7,6 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do
alias Pleroma.Object
alias Pleroma.Web.CommonAPI
alias Pleroma.Web.CommonAPI.Utils
alias Pleroma.Web.Endpoint
use Pleroma.DataCase
import ExUnit.CaptureLog
@ -42,28 +41,6 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do
end
end
test "parses emoji from name and bio" do
{:ok, user} = UserBuilder.insert(%{name: ":blank:", bio: ":firefox:"})
expected = [
%{
"type" => "Emoji",
"icon" => %{"type" => "Image", "url" => "#{Endpoint.url()}/emoji/Firefox.gif"},
"name" => ":firefox:"
},
%{
"type" => "Emoji",
"icon" => %{
"type" => "Image",
"url" => "#{Endpoint.url()}/emoji/blank.png"
},
"name" => ":blank:"
}
]
assert expected == Utils.emoji_from_profile(user)
end
describe "format_input/3" do
test "works for bare text/plain" do
text = "hello world!"