Merge branch 'release/2.1.2' into 'stable'
[akkoma] / test / web / common_api / common_api_test.exs
index 4ba6232dc7dafe2b3f59fb13e49ec7c95f5b9149..28bb6db30ff05e37125a39f141485a196eed1e4c 100644 (file)
@@ -213,6 +213,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