diff options
author | kaniini <nenolod@gmail.com> | 2019-06-05 08:28:20 +0000 |
---|---|---|
committer | kaniini <nenolod@gmail.com> | 2019-06-05 08:28:20 +0000 |
commit | e4babb1c9ff4c28ff08888736cc330a48b19b396 (patch) | |
tree | 3599c305e129871247fb97cf3923b8b96159856c /test/web/common_api/common_api_test.exs | |
parent | 5188add534a1532ef323a0fec3503f8e96dfe762 (diff) | |
parent | 18c35d84fd732a6d55c9d3174fcbb837e098ea0a (diff) | |
download | pleroma-e4babb1c9ff4c28ff08888736cc330a48b19b396.tar.gz pleroma-e4babb1c9ff4c28ff08888736cc330a48b19b396.zip |
Merge branch 'explicit-addressing' into 'develop'
Explicit addressing
See merge request pleroma/pleroma!1239
Diffstat (limited to 'test/web/common_api/common_api_test.exs')
-rw-r--r-- | test/web/common_api/common_api_test.exs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/web/common_api/common_api_test.exs b/test/web/common_api/common_api_test.exs index 696060fb1..26efe6140 100644 --- a/test/web/common_api/common_api_test.exs +++ b/test/web/common_api/common_api_test.exs @@ -56,6 +56,25 @@ defmodule Pleroma.Web.CommonAPITest do end describe "posting" do + test "it supports explicit addressing" do + user = insert(:user) + user_two = insert(:user) + user_three = insert(:user) + user_four = insert(:user) + + {:ok, activity} = + CommonAPI.post(user, %{ + "status" => + "Hey, I think @#{user_three.nickname} is ugly. @#{user_four.nickname} is alright though.", + "to" => [user_two.nickname, user_four.nickname, "nonexistent"] + }) + + assert user.ap_id in activity.recipients + assert user_two.ap_id in activity.recipients + assert user_four.ap_id in activity.recipients + refute user_three.ap_id in activity.recipients + end + test "it filters out obviously bad tags when accepting a post as HTML" do user = insert(:user) |