diff options
author | rinpatch <rinpatch@sdf.org> | 2020-05-27 14:17:12 +0000 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2020-05-27 14:17:12 +0000 |
commit | d35be02e7064da8ffce51fb10a937af30b145c7b (patch) | |
tree | 190b66745954121399abbb225784b470984006ce /test | |
parent | 91f73a7592049ffe2b1a99e86c6f4ee51218c768 (diff) | |
parent | 6bd7070b00a8d0ac64292f4c7152b71bee5f6b69 (diff) | |
download | pleroma-d35be02e7064da8ffce51fb10a937af30b145c7b.tar.gz pleroma-d35be02e7064da8ffce51fb10a937af30b145c7b.zip |
Merge branch 'refactor-add-mention-step-one' into 'develop'
Fix ObjectView calling into strange functions
Closes #1807
See merge request pleroma/pleroma!2580
Diffstat (limited to 'test')
-rw-r--r-- | test/web/activity_pub/transmogrifier_test.exs | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/test/web/activity_pub/transmogrifier_test.exs b/test/web/activity_pub/transmogrifier_test.exs index 356004d48..94d8552e8 100644 --- a/test/web/activity_pub/transmogrifier_test.exs +++ b/test/web/activity_pub/transmogrifier_test.exs @@ -1094,23 +1094,28 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do {:ok, activity} = CommonAPI.post(user, %{status: "hey, @#{other_user.nickname}, how are ya? #2hu"}) - {:ok, modified} = Transmogrifier.prepare_outgoing(activity.data) - object = modified["object"] + with_mock Pleroma.Notification, + get_notified_from_activity: fn _, _ -> [] end do + {:ok, modified} = Transmogrifier.prepare_outgoing(activity.data) - expected_mention = %{ - "href" => other_user.ap_id, - "name" => "@#{other_user.nickname}", - "type" => "Mention" - } + object = modified["object"] - expected_tag = %{ - "href" => Pleroma.Web.Endpoint.url() <> "/tags/2hu", - "type" => "Hashtag", - "name" => "#2hu" - } + expected_mention = %{ + "href" => other_user.ap_id, + "name" => "@#{other_user.nickname}", + "type" => "Mention" + } - assert Enum.member?(object["tag"], expected_tag) - assert Enum.member?(object["tag"], expected_mention) + expected_tag = %{ + "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 test "it adds the sensitive property" do |