ObjectValidators: Add basic UpdateValidator.
This commit is contained in:
parent
7e488cd4a7
commit
abdb540d45
4 changed files with 89 additions and 0 deletions
|
|
@ -622,4 +622,24 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidatorTest do
|
|||
assert {:actor, {"can not announce this object publicly", []}} in cng.errors
|
||||
end
|
||||
end
|
||||
|
||||
describe "updates" do
|
||||
setup do
|
||||
user = insert(:user)
|
||||
|
||||
object = %{
|
||||
"id" => user.ap_id,
|
||||
"name" => "A new name",
|
||||
"summary" => "A new bio"
|
||||
}
|
||||
|
||||
{:ok, valid_update, []} = Builder.update(user, object)
|
||||
|
||||
%{user: user, valid_update: valid_update}
|
||||
end
|
||||
|
||||
test "validates a basic object", %{valid_update: valid_update} do
|
||||
assert {:ok, _update, []} = ObjectValidator.validate(valid_update, [])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue