Get rid of Pleroma.Config in favor of Application
Discussed in https://git.pleroma.social/pleroma/pleroma/merge_requests/426#note_7232
This commit is contained in:
parent
0f6c4635a6
commit
2bc924ba45
7 changed files with 25 additions and 38 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue