diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/web/activity_pub/object_validators/update_validation_test.exs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/web/activity_pub/object_validators/update_validation_test.exs b/test/web/activity_pub/object_validators/update_validation_test.exs index 5e80cf731..377aab841 100644 --- a/test/web/activity_pub/object_validators/update_validation_test.exs +++ b/test/web/activity_pub/object_validators/update_validation_test.exs @@ -5,8 +5,10 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.UpdateHandlingTest do use Pleroma.DataCase + alias Pleroma.Object alias Pleroma.Web.ActivityPub.Builder alias Pleroma.Web.ActivityPub.ObjectValidator + alias Pleroma.Web.CommonAPI import Pleroma.Factory @@ -40,5 +42,19 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.UpdateHandlingTest do assert {:error, _cng} = ObjectValidator.validate(update, []) end + + test "validates a user updating their own note", %{user: user} do + {:ok, activity} = CommonAPI.post(user, %{status: "I love cafe"}) + + object = Object.normalize(activity) + + updated_object = + object.data + |> Map.put("content", "I love cofe") + + {:ok, update, []} = Builder.update(user, updated_object) + + assert {ok, _update, []} = ObjectValidator.validate(update, []) + end end end |