|
|
@ -1094,23 +1094,28 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
|
|
|
|
{:ok, activity} =
|
|
|
|
{:ok, activity} =
|
|
|
|
CommonAPI.post(user, %{status: "hey, @#{other_user.nickname}, how are ya? #2hu"})
|
|
|
|
CommonAPI.post(user, %{status: "hey, @#{other_user.nickname}, how are ya? #2hu"})
|
|
|
|
|
|
|
|
|
|
|
|
{:ok, modified} = Transmogrifier.prepare_outgoing(activity.data)
|
|
|
|
with_mock Pleroma.Notification,
|
|
|
|
object = modified["object"]
|
|
|
|
get_notified_from_activity: fn _, _ -> [] end do
|
|
|
|
|
|
|
|
{:ok, modified} = Transmogrifier.prepare_outgoing(activity.data)
|
|
|
|
|
|
|
|
|
|
|
|
expected_mention = %{
|
|
|
|
object = modified["object"]
|
|
|
|
"href" => other_user.ap_id,
|
|
|
|
|
|
|
|
"name" => "@#{other_user.nickname}",
|
|
|
|
|
|
|
|
"type" => "Mention"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
expected_tag = %{
|
|
|
|
expected_mention = %{
|
|
|
|
"href" => Pleroma.Web.Endpoint.url() <> "/tags/2hu",
|
|
|
|
"href" => other_user.ap_id,
|
|
|
|
"type" => "Hashtag",
|
|
|
|
"name" => "@#{other_user.nickname}",
|
|
|
|
"name" => "#2hu"
|
|
|
|
"type" => "Mention"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
assert Enum.member?(object["tag"], expected_tag)
|
|
|
|
expected_tag = %{
|
|
|
|
assert Enum.member?(object["tag"], expected_mention)
|
|
|
|
"href" => Pleroma.Web.Endpoint.url() <> "/tags/2hu",
|
|
|
|
|
|
|
|
"type" => "Hashtag",
|
|
|
|
|
|
|
|
"name" => "#2hu"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
refute called(Pleroma.Notification.get_notified_from_activity(:_, :_))
|
|
|
|
|
|
|
|
assert Enum.member?(object["tag"], expected_tag)
|
|
|
|
|
|
|
|
assert Enum.member?(object["tag"], expected_mention)
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
test "it adds the sensitive property" do
|
|
|
|
test "it adds the sensitive property" do
|
|
|
|