AcceptValidation: Codify accept rules.

This commit is contained in:
lain 2020-08-11 15:32:00 +02:00
commit 8b1e8bec2f
2 changed files with 26 additions and 1 deletions

View file

@ -41,4 +41,15 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.AcceptValidationTest do
assert {:error, _} = ObjectValidator.validate(accept_data, [])
end
test "for an accepted follow, it only validates if the actor of the accept is the followed actor",
%{accept_data: accept_data} do
stranger = insert(:user)
accept_data =
accept_data
|> Map.put("actor", stranger.ap_id)
assert {:error, _} = ObjectValidator.validate(accept_data, [])
end
end