diff options
author | lain <lain@soykaf.club> | 2018-02-18 13:51:03 +0100 |
---|---|---|
committer | lain <lain@soykaf.club> | 2018-02-18 13:51:03 +0100 |
commit | 6ab0aba50a1b41c027c0c23cc6342719ba439e06 (patch) | |
tree | 14a225925f62c43b0d63d5f430c1fc25d93ba3a6 /test | |
parent | 6046f10431390fa2ecef4b8d8a95b5d8db03fd2d (diff) | |
download | pleroma-6ab0aba50a1b41c027c0c23cc6342719ba439e06.tar.gz pleroma-6ab0aba50a1b41c027c0c23cc6342719ba439e06.zip |
Transmogrify outgoing hashtags.
Diffstat (limited to 'test')
-rw-r--r-- | test/web/activity_pub/transmogrifier_test.exs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/test/web/activity_pub/transmogrifier_test.exs b/test/web/activity_pub/transmogrifier_test.exs index a39f4c139..e2db615eb 100644 --- a/test/web/activity_pub/transmogrifier_test.exs +++ b/test/web/activity_pub/transmogrifier_test.exs @@ -100,18 +100,24 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do user = insert(:user) other_user = insert(:user) - {:ok, activity} = CommonAPI.post(user, %{"status" => "hey, @#{other_user.nickname}, how are ya?"}) + {:ok, activity} = CommonAPI.post(user, %{"status" => "hey, @#{other_user.nickname}, how are ya? #2hu"}) {:ok, modified} = Transmogrifier.prepare_outgoing(activity.data) object = modified["object"] - expected_tag = %{ + expected_mention = %{ "href" => other_user.ap_id, "name" => "@#{other_user.nickname}", "type" => "Mention" } + expected_tag = %{ + "href" => Pleroma.Web.Endpoint.url <> "/tags/2hu", + "type" => "Hashtag", + "name" => "#2hu" + } assert Enum.member?(object["tag"], expected_tag) + assert Enum.member?(object["tag"], expected_mention) end test "it adds the json-ld context" do |