"https://example.org is the site of @#{other_user.nickname}#2hu"
)
assertother_user.ap_idnotinactivity.recipients
object=Object.normalize(activity,fetch:false)
assertobject.data["content"]==
"<a href=\"https://example.org\" rel=\"ugc\">https://example.org</a> is the site of <span class=\"h-card\"><a class=\"u-url mention\" data-user=\"#{other_user.id}\" href=\"#{other_user.ap_id}\" rel=\"ugc\">@<span>#{other_user.nickname}</span></a></span> <a class=\"hashtag\" data-tag=\"2hu\" href=\"http://localhost:4001/tag/2hu\">#2hu</a>"
end
test"it posts a chat message"do
author=insert(:user)
recipient=insert(:user)
{:ok,activity}=
CommonAPI.post_chat_message(
author,
recipient,
"a test message <script>alert('uuu')</script> :firefox:"
)
assertactivity.data["type"]=="Create"
assertactivity.local
object=Object.normalize(activity,fetch:false)
assertobject.data["type"]=="ChatMessage"
assertobject.data["to"]==[recipient.ap_id]
assertobject.data["content"]==
"a test message <script>alert('uuu')</script> :firefox:"