diff options
author | lain <lain@soykaf.club> | 2020-06-19 15:30:30 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-06-19 15:30:30 +0200 |
commit | abdb540d450b5e68ea452f78d865d63bca764a49 (patch) | |
tree | d2ff9d5f8356cadce8c4207bc32982c0f086cfe7 /test | |
parent | 7e488cd4a7ac038dfe8a1f5b204cb134bb5ba549 (diff) | |
download | pleroma-abdb540d450b5e68ea452f78d865d63bca764a49.tar.gz pleroma-abdb540d450b5e68ea452f78d865d63bca764a49.zip |
ObjectValidators: Add basic UpdateValidator.
Diffstat (limited to 'test')
-rw-r--r-- | test/web/activity_pub/object_validator_test.exs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/web/activity_pub/object_validator_test.exs b/test/web/activity_pub/object_validator_test.exs index 31224abe0..adb56092d 100644 --- a/test/web/activity_pub/object_validator_test.exs +++ b/test/web/activity_pub/object_validator_test.exs @@ -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 |