diff options
author | lain <lain@soykaf.club> | 2019-03-25 13:37:32 +0100 |
---|---|---|
committer | lain <lain@soykaf.club> | 2019-03-25 13:37:32 +0100 |
commit | 037fefe21871ee0a1926286c87c334ea1d339394 (patch) | |
tree | 2775b91de5652ddd5baa3e32861ac9cac4bc40be /test/web/common_api/common_api_test.exs | |
parent | f6fab01ba7a08fe0e5147f82d9e3dd294922dc93 (diff) | |
parent | b028b0f97d4b6310b1402b3b876aa8f8b286bc4d (diff) | |
download | pleroma-037fefe21871ee0a1926286c87c334ea1d339394.tar.gz |
Merge remote-tracking branch 'origin/develop' into features/mastoapi/2.6.0-conversations
Diffstat (limited to 'test/web/common_api/common_api_test.exs')
-rw-r--r-- | test/web/common_api/common_api_test.exs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/web/common_api/common_api_test.exs b/test/web/common_api/common_api_test.exs index f83f80b40..34aa5bf18 100644 --- a/test/web/common_api/common_api_test.exs +++ b/test/web/common_api/common_api_test.exs @@ -10,6 +10,24 @@ defmodule Pleroma.Web.CommonAPITest do import Pleroma.Factory + test "with the safe_dm_mention option set, it does not mention people beyond the initial tags" do + har = insert(:user) + jafnhar = insert(:user) + tridi = insert(:user) + option = Pleroma.Config.get([:instance, :safe_dm_mentions]) + Pleroma.Config.put([:instance, :safe_dm_mentions], true) + + {:ok, activity} = + CommonAPI.post(har, %{ + "status" => "@#{jafnhar.nickname} hey, i never want to see @#{tridi.nickname} again", + "visibility" => "direct" + }) + + refute tridi.ap_id in activity.recipients + assert jafnhar.ap_id in activity.recipients + Pleroma.Config.put([:instance, :safe_dm_mentions], option) + end + test "it de-duplicates tags" do user = insert(:user) {:ok, activity} = CommonAPI.post(user, %{"status" => "#2hu #2HU"}) |