aboutsummaryrefslogtreecommitdiff
path: root/test/web/common_api/common_api_test.exs
diff options
context:
space:
mode:
authorEgor Kislitsyn <egor@kislitsyn.com>2019-06-05 17:53:15 +0700
committerEgor Kislitsyn <egor@kislitsyn.com>2019-06-05 17:53:15 +0700
commitcfa5572d28a5a7b58d73106c32420b14ffd9fd2a (patch)
treed093f206f5ea5b792b22b0e59b31b76ac64c1bc6 /test/web/common_api/common_api_test.exs
parent6ba9055b51a454baaf063943e72a39006f7e5fad (diff)
parente4babb1c9ff4c28ff08888736cc330a48b19b396 (diff)
downloadpleroma-cfa5572d28a5a7b58d73106c32420b14ffd9fd2a.tar.gz
Merge remote-tracking branch 'pleroma/develop' into feature/addressable-lists
Diffstat (limited to 'test/web/common_api/common_api_test.exs')
-rw-r--r--test/web/common_api/common_api_test.exs19
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 58305d09b..9ef79e9c9 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)