Merge branch 'follow-pipeline' into 'develop'

Handle `Follow` activities with the pipeline

See merge request pleroma/pleroma!2734
This commit is contained in:
Haelwenn 2020-07-09 10:32:24 +00:00
commit 68036f5a3b
31 changed files with 1006 additions and 827 deletions

View file

@ -10,6 +10,8 @@ defmodule Mix.Tasks.Pleroma.RelayTest do
alias Pleroma.Web.ActivityPub.Utils
use Pleroma.DataCase
import Pleroma.Factory
setup_all do
Tesla.Mock.mock_global(fn env -> apply(HttpRequestMock, :request, [env]) end)
@ -46,7 +48,8 @@ defmodule Mix.Tasks.Pleroma.RelayTest do
describe "running unfollow" do
test "relay is unfollowed" do
target_instance = "http://mastodon.example.org/users/admin"
user = insert(:user)
target_instance = user.ap_id
Mix.Tasks.Pleroma.Relay.run(["follow", target_instance])
@ -71,7 +74,7 @@ defmodule Mix.Tasks.Pleroma.RelayTest do
assert undo_activity.data["type"] == "Undo"
assert undo_activity.data["actor"] == local_user.ap_id
assert undo_activity.data["object"] == cancelled_activity.data
assert undo_activity.data["object"]["id"] == cancelled_activity.data["id"]
refute "#{target_instance}/followers" in User.following(local_user)
end
end