diff options
author | Alexander Strizhakov <alex.strizhakov@gmail.com> | 2020-02-25 17:58:15 +0300 |
---|---|---|
committer | Alexander Strizhakov <alex.strizhakov@gmail.com> | 2020-02-25 18:08:01 +0300 |
commit | 1c05ff7c06e281fe2abd05ff4969e30ec7268bb1 (patch) | |
tree | b7acaaa4b2689cf3c3b956e0a7efd0342bfcc8bc /test/web | |
parent | 42f76306e7fe69fc51be00285a4fef8569f54989 (diff) | |
download | pleroma-relay-list-change-for-stable.tar.gz |
relay list shows hosts without accepted followrelay-list-change-for-stable
Diffstat (limited to 'test/web')
-rw-r--r-- | test/web/activity_pub/activity_pub_controller_test.exs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/web/activity_pub/activity_pub_controller_test.exs b/test/web/activity_pub/activity_pub_controller_test.exs index fa2364bd2..027a19cd4 100644 --- a/test/web/activity_pub/activity_pub_controller_test.exs +++ b/test/web/activity_pub/activity_pub_controller_test.exs @@ -322,6 +322,40 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubControllerTest do assert "ok" == json_response(conn, 200) assert Instances.reachable?(sender_url) end + + test "accept follow activity", %{conn: conn} do + Pleroma.Config.put([:instance, :federating], true) + relay = Relay.get_actor() + + assert {:ok, %Activity{} = activity} = Relay.follow("https://relay.mastodon.host/actor") + + followed_relay = Pleroma.User.get_by_ap_id("https://relay.mastodon.host/actor") + + accept = + File.read!("test/fixtures/relay/accept-follow.json") + |> String.replace("{{ap_id}}", relay.ap_id) + |> String.replace("{{activity_id}}", activity.data["id"]) + + assert "ok" == + conn + |> assign(:valid_signature, true) + |> put_req_header("content-type", "application/activity+json") + |> post("/inbox", accept) + |> json_response(200) + + relay = refresh_record(relay) + + assert followed_relay.follower_address in relay.following + + Mix.shell(Mix.Shell.Process) + + on_exit(fn -> + Mix.shell(Mix.Shell.IO) + end) + + :ok = Mix.Tasks.Pleroma.Relay.run(["list"]) + assert_receive {:mix_shell, :info, ["relay.mastodon.host"]} + end end describe "/users/:nickname/inbox" do |