diff options
author | lain <lain@soykaf.club> | 2019-10-17 19:35:31 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2019-10-17 19:35:31 +0200 |
commit | 203d61b95012fd2cb8a8618f6f51a3748c940cc1 (patch) | |
tree | 6ebd3d56a5766d4d8aacf8393ef5b8c33b07faf4 /test | |
parent | 66452f518faa1f079f02006943b0c2cdc830b47f (diff) | |
download | pleroma-203d61b95012fd2cb8a8618f6f51a3748c940cc1.tar.gz |
Transmogrifier: Make proper use of the LikeValidator.
Diffstat (limited to 'test')
-rw-r--r-- | test/web/activity_pub/object_validator_test.exs | 2 | ||||
-rw-r--r-- | test/web/activity_pub/transmogrifier_test.exs | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/test/web/activity_pub/object_validator_test.exs b/test/web/activity_pub/object_validator_test.exs index 374a7c0df..2292db6d7 100644 --- a/test/web/activity_pub/object_validator_test.exs +++ b/test/web/activity_pub/object_validator_test.exs @@ -13,6 +13,8 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidatorTest do {:ok, post_activity} = CommonAPI.post(user, %{"status" => "uguu"}) valid_like = %{ + "to" => [user.ap_id], + "cc" => [], "type" => "Like", "id" => Utils.generate_activity_id(), "object" => post_activity.data["object"], diff --git a/test/web/activity_pub/transmogrifier_test.exs b/test/web/activity_pub/transmogrifier_test.exs index 28edc5508..e5d4dcd64 100644 --- a/test/web/activity_pub/transmogrifier_test.exs +++ b/test/web/activity_pub/transmogrifier_test.exs @@ -333,7 +333,9 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do |> Poison.decode!() |> Map.put("object", activity.data["object"]) - {:ok, %Activity{data: data, local: false}} = Transmogrifier.handle_incoming(data) + {:ok, %Activity{data: data, local: false} = activity} = Transmogrifier.handle_incoming(data) + + refute Enum.empty?(activity.recipients) assert data["actor"] == "http://mastodon.example.org/users/admin" assert data["type"] == "Like" |