summaryrefslogtreecommitdiff
path: root/test/web/activity_pub
diff options
context:
space:
mode:
authorhref <href@random.sh>2018-11-06 11:34:34 +0100
committerhref <href@random.sh>2018-11-06 15:12:53 +0100
commit2bc924ba451b1a324663133632093914192cec2d (patch)
treefbee2b582ce477f9db6f0dce5e9a7add4867902d /test/web/activity_pub
parent0f6c4635a64e89cc72921456e6cfa3d488d894bf (diff)
downloadpleroma-2bc924ba451b1a324663133632093914192cec2d.tar.gz
pleroma-2bc924ba451b1a324663133632093914192cec2d.zip
Get rid of Pleroma.Config in favor of Application
Discussed in https://git.pleroma.social/pleroma/pleroma/merge_requests/426#note_7232
Diffstat (limited to 'test/web/activity_pub')
-rw-r--r--test/web/activity_pub/activity_pub_controller_test.exs16
1 files changed, 12 insertions, 4 deletions
diff --git a/test/web/activity_pub/activity_pub_controller_test.exs b/test/web/activity_pub/activity_pub_controller_test.exs
index 5b46bbe76..524ed9eaa 100644
--- a/test/web/activity_pub/activity_pub_controller_test.exs
+++ b/test/web/activity_pub/activity_pub_controller_test.exs
@@ -4,12 +4,9 @@ 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))
@@ -19,12 +16,23 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubControllerTest do
end
test "with the relay disabled, it returns 404", %{conn: conn} do
- Config.put([:instance, :allow_relay], false)
+ instance =
+ Application.get_env(:pleroma, :instance)
+ |> Keyword.put(:allow_relay, false)
+
+ Application.put_env(:pleroma, :instance, instance)
res =
conn
|> get(activity_pub_path(conn, :relay))
|> json_response(404)
+
+ instance =
+ Application.get_env(:pleroma, :instance)
+ |> Keyword.put(:allow_relay, true)
+
+ Application.put_env(:pleroma, :instance, instance)
+
end
end