Federate emoji out.
This commit is contained in:
parent
79aeb219d8
commit
884006a9e9
6 changed files with 26 additions and 5 deletions
|
|
@ -49,6 +49,12 @@ defmodule Pleroma.FormatterTest do
|
|||
|
||||
expected_result = "I love <img height='32px' width='32px' alt='moominmamma' title='moominmamma' src='/finmoji/128px/moominmamma-128.png' />"
|
||||
|
||||
assert Formatter.finmojifiy(text) == expected_result
|
||||
assert Formatter.emojify(text) == expected_result
|
||||
end
|
||||
|
||||
test "it returns the emoji used in the text" do
|
||||
text = "I love :moominmamma:"
|
||||
|
||||
assert Formatter.get_emoji(text) == [{"moominmamma", "/finmoji/128px/moominmamma-128.png"}]
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ defmodule Pleroma.Factory do
|
|||
end
|
||||
|
||||
def note_factory do
|
||||
text = sequence(:text, &"This is note #{&1}")
|
||||
text = sequence(:text, &"This is :moominmamma: note #{&1}")
|
||||
|
||||
user = insert(:user)
|
||||
data = %{
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ defmodule Pleroma.Web.OStatus.ActivityRepresenterTest do
|
|||
<link type="text/html" href="#{note_activity.data["object"]["id"]}" rel="alternate" />
|
||||
<category term="2hu"/>
|
||||
<link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/>
|
||||
<link name="moominmamma" rel="emoji" href="#{Pleroma.Web.Endpoint.static_url}/finmoji/128px/moominmamma-128.png" />
|
||||
"""
|
||||
|
||||
tuple = ActivityRepresenter.to_simple_form(note_activity, user)
|
||||
|
|
@ -78,6 +79,7 @@ defmodule Pleroma.Web.OStatus.ActivityRepresenterTest do
|
|||
<category term="2hu"/>
|
||||
<thr:in-reply-to ref="#{note.data["object"]["id"]}" href="someurl" />
|
||||
<link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/>
|
||||
<link name="moominmamma" rel="emoji" href="#{Pleroma.Web.Endpoint.static_url}/finmoji/128px/moominmamma-128.png" />
|
||||
"""
|
||||
|
||||
tuple = ActivityRepresenter.to_simple_form(answer, user)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue