Add Undo of Follow Activity insertion

This commit is contained in:
dtluna 2017-04-21 19:54:21 +03:00
commit 28b203d08f
6 changed files with 51 additions and 6 deletions

View file

@ -64,4 +64,21 @@ defmodule Pleroma.Factory do
data: data
}
end
def follow_activity_factory do
follower = insert(:user)
followed = insert(:user)
data = %{
"id" => Pleroma.Web.ActivityPub.ActivityPub.generate_activity_id,
"actor" => follower.ap_id,
"type" => "Follow",
"object" => followed.ap_id,
"published_at" => DateTime.utc_now() |> DateTime.to_iso8601
}
%Pleroma.Activity{
data: data
}
end
end

View file

@ -41,7 +41,7 @@ defmodule Pleroma.UserTest do
followed = insert(:user)
user = insert(:user, %{following: [User.ap_followers(followed)]})
{:ok, user } = User.unfollow(user, followed)
{:ok, user, _activity } = User.unfollow(user, followed)
user = Repo.get(User, user.id)

File diff suppressed because one or more lines are too long