summaryrefslogtreecommitdiff
path: root/test/web/common_api/common_api_test.exs
diff options
context:
space:
mode:
authorHaelwenn (lanodan) Monnier <contact@hacktivis.me>2020-09-14 14:07:22 +0200
committerrinpatch <rinpatch@sdf.org>2020-09-17 22:07:54 +0300
commit7bf269fe836ded974d2187c6b36eba4ab185ff25 (patch)
tree0f809748247ceb0c792358500da5b5f352446828 /test/web/common_api/common_api_test.exs
parentabf25e5d5254edc88a65610bf5a0fd7e52f545c3 (diff)
downloadpleroma-7bf269fe836ded974d2187c6b36eba4ab185ff25.tar.gz
pleroma-7bf269fe836ded974d2187c6b36eba4ab185ff25.zip
Fix MRF reject for ChatMessage
Diffstat (limited to 'test/web/common_api/common_api_test.exs')
-rw-r--r--test/web/common_api/common_api_test.exs11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/web/common_api/common_api_test.exs b/test/web/common_api/common_api_test.exs
index f5559f932..2eab64e8b 100644
--- a/test/web/common_api/common_api_test.exs
+++ b/test/web/common_api/common_api_test.exs
@@ -217,6 +217,17 @@ defmodule Pleroma.Web.CommonAPITest do
assert message == :content_too_long
end
+
+ test "it reject messages via MRF" do
+ clear_config([:mrf_keyword, :reject], ["GNO"])
+ clear_config([:mrf, :policies], [Pleroma.Web.ActivityPub.MRF.KeywordPolicy])
+
+ author = insert(:user)
+ recipient = insert(:user)
+
+ assert {:reject, "[KeywordPolicy] Matches with rejected keyword"} ==
+ CommonAPI.post_chat_message(author, recipient, "GNO/Linux")
+ end
end
describe "unblocking" do