diff options
Diffstat (limited to 'test/web/activity_pub/activity_pub_controller_test.exs')
-rw-r--r-- | test/web/activity_pub/activity_pub_controller_test.exs | 23 |
1 files changed, 23 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 e63cd6583..5b46bbe76 100644 --- a/test/web/activity_pub/activity_pub_controller_test.exs +++ b/test/web/activity_pub/activity_pub_controller_test.exs @@ -4,6 +4,29 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubControllerTest do alias Pleroma.Web.ActivityPub.{UserView, ObjectView} alias Pleroma.{Repo, User} alias Pleroma.Activity + alias Pleroma.Config + + describe "/relay" do + test "with the relay active, it returns the relay user", %{conn: conn} do + Config.put([:instance, :allow_relay], true) + + res = + conn + |> get(activity_pub_path(conn, :relay)) + |> json_response(200) + + assert res["id"] =~ "/relay" + end + + test "with the relay disabled, it returns 404", %{conn: conn} do + Config.put([:instance, :allow_relay], false) + + res = + conn + |> get(activity_pub_path(conn, :relay)) + |> json_response(404) + end + end describe "/users/:nickname" do test "it returns a json representation of the user", %{conn: conn} do |