diff options
author | lain <lain@soykaf.club> | 2020-05-18 16:54:10 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-05-18 16:54:10 +0200 |
commit | 0d5bce018df9c99c771daaaa1de3ab0efc0cba5c (patch) | |
tree | 1f43336950f76e39748084b48e650634718272de /test | |
parent | 17a8342c1e2bd615edb8e41535aa96c1b22d440a (diff) | |
download | pleroma-0d5bce018df9c99c771daaaa1de3ab0efc0cba5c.tar.gz |
AnnounceValidator: Validate for existing announce
Diffstat (limited to 'test')
-rw-r--r-- | test/web/activity_pub/object_validator_test.exs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/web/activity_pub/object_validator_test.exs b/test/web/activity_pub/object_validator_test.exs index 9313015f1..e24e0f913 100644 --- a/test/web/activity_pub/object_validator_test.exs +++ b/test/web/activity_pub/object_validator_test.exs @@ -329,5 +329,18 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidatorTest do assert {:actor, {"can't find user", []}} in cng.errors end + + test "returns an error if the actor already announced the object", %{ + valid_announce: valid_announce, + announcer: announcer, + post_activity: post_activity + } do + _announce = CommonAPI.repeat(post_activity.id, announcer) + + {:error, cng} = ObjectValidator.validate(valid_announce, []) + + assert {:actor, {"already announced this object", []}} in cng.errors + assert {:object, {"already announced by this actor", []}} in cng.errors + end end end |