projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
DeleteValidator: Deleting a user is valid.
[akkoma]
/
test
/
web
/
activity_pub
/
object_validator_test.exs
diff --git
a/test/web/activity_pub/object_validator_test.exs
b/test/web/activity_pub/object_validator_test.exs
index ab26d350135a1759ea1a65d6f7c78e0a9659b867..83b21a9bcc1dfb795d8f1450f10e4c6b46a5961c 100644
(file)
--- a/
test/web/activity_pub/object_validator_test.exs
+++ b/
test/web/activity_pub/object_validator_test.exs
@@
-15,14
+15,19
@@
defmodule Pleroma.Web.ActivityPub.ObjectValidatorTest do
{:ok, post_activity} = CommonAPI.post(user, %{"status" => "cancel me daddy"})
{:ok, valid_post_delete, _} = Builder.delete(user, post_activity.data["object"])
{:ok, post_activity} = CommonAPI.post(user, %{"status" => "cancel me daddy"})
{:ok, valid_post_delete, _} = Builder.delete(user, post_activity.data["object"])
+ {:ok, valid_user_delete, _} = Builder.delete(user, user.ap_id)
- %{user: user, valid_post_delete: valid_post_delete}
+ %{user: user, valid_post_delete: valid_post_delete
, valid_user_delete: valid_user_delete
}
end
test "it is valid for a post deletion", %{valid_post_delete: valid_post_delete} do
assert match?({:ok, _, _}, ObjectValidator.validate(valid_post_delete, []))
end
end
test "it is valid for a post deletion", %{valid_post_delete: valid_post_delete} do
assert match?({:ok, _, _}, ObjectValidator.validate(valid_post_delete, []))
end
+ test "it is valid for a user deletion", %{valid_user_delete: valid_user_delete} do
+ assert match?({:ok, _, _}, ObjectValidator.validate(valid_user_delete, []))
+ end
+
test "it's invalid if the id is missing", %{valid_post_delete: valid_post_delete} do
no_id =
valid_post_delete
test "it's invalid if the id is missing", %{valid_post_delete: valid_post_delete} do
no_id =
valid_post_delete