summaryrefslogtreecommitdiff
path: root/test/web/common_api/common_api_test.exs
diff options
context:
space:
mode:
authorIvan Tashkinov <ivantashkinov@gmail.com>2020-09-17 22:22:59 +0300
committerIvan Tashkinov <ivantashkinov@gmail.com>2020-09-17 22:22:59 +0300
commita42880040574701000470fc1c2dbd6f7242c1a06 (patch)
tree666d244b9bf4f38b4421deea8d3b8bbb10ec179e /test/web/common_api/common_api_test.exs
parentd9fb5bc08ad67b55d0cd25c1a0d7d3a740758427 (diff)
parent7bf269fe836ded974d2187c6b36eba4ab185ff25 (diff)
downloadpleroma-a42880040574701000470fc1c2dbd6f7242c1a06.tar.gz
pleroma-a42880040574701000470fc1c2dbd6f7242c1a06.zip
Merge remote-tracking branch 'remotes/origin/develop' into media-preview-proxy-nostream
# Conflicts: # CHANGELOG.md
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