ActivityPub.Utils: Fix undo test.

This commit is contained in:
lain 2019-10-04 17:10:49 +02:00 committed by Ariadne Conill
parent b7d2ca0372
commit a0435dca26

View File

@ -94,11 +94,13 @@ defmodule Pleroma.Web.ActivityPub.UtilsTest do
user = insert(:user) user = insert(:user)
like_activity = insert(:like_activity, data_attrs: %{"context" => "test context"}) like_activity = insert(:like_activity, data_attrs: %{"context" => "test context"})
object = Object.normalize(like_activity.data["object"])
assert Utils.make_unlike_data(user, like_activity, nil) == %{ assert Utils.make_unlike_data(user, like_activity, nil) == %{
"type" => "Undo", "type" => "Undo",
"actor" => user.ap_id, "actor" => user.ap_id,
"object" => like_activity.data, "object" => like_activity.data,
"to" => [user.follower_address, like_activity.data["actor"]], "to" => [user.follower_address, object.data["actor"]],
"cc" => [Pleroma.Constants.as_public()], "cc" => [Pleroma.Constants.as_public()],
"context" => like_activity.data["context"] "context" => like_activity.data["context"]
} }
@ -107,7 +109,7 @@ defmodule Pleroma.Web.ActivityPub.UtilsTest do
"type" => "Undo", "type" => "Undo",
"actor" => user.ap_id, "actor" => user.ap_id,
"object" => like_activity.data, "object" => like_activity.data,
"to" => [user.follower_address, like_activity.data["actor"]], "to" => [user.follower_address, object.data["actor"]],
"cc" => [Pleroma.Constants.as_public()], "cc" => [Pleroma.Constants.as_public()],
"context" => like_activity.data["context"], "context" => like_activity.data["context"],
"id" => "9mJEZK0tky1w2xD2vY" "id" => "9mJEZK0tky1w2xD2vY"