Skip to content
Snippets Groups Projects
Commit e2e66e50 authored by lain's avatar lain
Browse files

SimplePolicyTest: Add test for leaking DMs.

parent 702f0fb8
Branches pleroma-mrf-silence
No related tags found
No related merge requests found
Pipeline #29228 failed
......@@ -290,6 +290,15 @@ test "has a matching host" do
"cc" => [actor.follower_address, "http://foo.bar/qux"]
}
dm_activity = %{
"actor" => actor.ap_id,
"to" => [
following_user.ap_id,
non_following_user.ap_id
],
"cc" => []
}
actor_domain =
activity
|> Map.fetch!("actor")
......@@ -305,6 +314,10 @@ test "has a matching host" do
refute "https://www.w3.org/ns/activitystreams#Public" in new_activity["cc"]
refute non_following_user.ap_id in new_activity["to"]
refute non_following_user.ap_id in new_activity["cc"]
assert {:ok, new_dm_activity} = SimplePolicy.filter(dm_activity)
assert new_dm_activity["to"] == [following_user.ap_id]
assert new_dm_activity["cc"] == []
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment