summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTusooa Zhu <tusooa@kazv.moe>2022-07-23 23:24:25 -0400
committerTusooa Zhu <tusooa@kazv.moe>2022-07-23 23:24:25 -0400
commit82c8fc1ede26837d024ecc2fd1231c6d2a3c2c3e (patch)
tree15034f1f5725668ae023eaf93c9d16daa25461e9 /test
parent46a5c06853c21e720b41a4b38a4d88a38a218ad4 (diff)
downloadpleroma-82c8fc1ede26837d024ecc2fd1231c6d2a3c2c3e.tar.gz
pleroma-82c8fc1ede26837d024ecc2fd1231c6d2a3c2c3e.zip
Make NoEmptyPolicy work with Update
Diffstat (limited to 'test')
-rw-r--r--test/pleroma/web/activity_pub/mrf/no_empty_policy_test.exs23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/pleroma/web/activity_pub/mrf/no_empty_policy_test.exs b/test/pleroma/web/activity_pub/mrf/no_empty_policy_test.exs
index fe4bb8f0a..386ed395f 100644
--- a/test/pleroma/web/activity_pub/mrf/no_empty_policy_test.exs
+++ b/test/pleroma/web/activity_pub/mrf/no_empty_policy_test.exs
@@ -151,4 +151,27 @@ defmodule Pleroma.Web.ActivityPub.MRF.NoEmptyPolicyTest do
assert NoEmptyPolicy.filter(message) == {:reject, "[NoEmptyPolicy]"}
end
+
+ test "works with Update" do
+ message = %{
+ "actor" => "http://localhost:4001/users/testuser",
+ "cc" => ["http://localhost:4001/users/testuser/followers"],
+ "object" => %{
+ "actor" => "http://localhost:4001/users/testuser",
+ "attachment" => [],
+ "cc" => ["http://localhost:4001/users/testuser/followers"],
+ "source" => "",
+ "to" => [
+ "https://www.w3.org/ns/activitystreams#Public"
+ ],
+ "type" => "Note"
+ },
+ "to" => [
+ "https://www.w3.org/ns/activitystreams#Public"
+ ],
+ "type" => "Update"
+ }
+
+ assert NoEmptyPolicy.filter(message) == {:reject, "[NoEmptyPolicy]"}
+ end
end