formatter.ex: Add get_emoji_map/1
This commit is contained in:
parent
d70af32127
commit
2f76a40d02
7 changed files with 72 additions and 10 deletions
|
|
@ -1611,6 +1611,34 @@ defmodule Pleroma.Web.TwitterAPI.ControllerTest do
|
|||
|
||||
assert json_response(conn, 200) == UserView.render("user.json", %{user: user, for: user})
|
||||
end
|
||||
|
||||
# Broken before the change to class="emoji" and non-<img/> in the DB
|
||||
@tag :skip
|
||||
test "it formats emojos", %{conn: conn} do
|
||||
user = insert(:user)
|
||||
|
||||
conn =
|
||||
conn
|
||||
|> assign(:user, user)
|
||||
|> post("/api/account/update_profile.json", %{
|
||||
"bio" => "I love our :moominmamma:"
|
||||
})
|
||||
|
||||
assert response = json_response(conn, 200)
|
||||
|
||||
assert %{
|
||||
"description" => "I love our :moominmamma:",
|
||||
"description_html" =>
|
||||
~s{I love our <img class="emoji" alt="moominmamma" title="moominmamma" src="} <>
|
||||
_
|
||||
} = response
|
||||
|
||||
conn =
|
||||
conn
|
||||
|> get("/api/users/show.json?user_id=#{user.nickname}")
|
||||
|
||||
assert response == json_response(conn, 200)
|
||||
end
|
||||
end
|
||||
|
||||
defp valid_user(_context) do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue