Small wrapper module around Application.get_env/put_env

Same API as the old Pleroma.Config
This commit is contained in:
href 2018-11-06 16:00:48 +01:00
commit 7d328c658d
No known key found for this signature in database
GPG key ID: EE8296C1A152C325
4 changed files with 69 additions and 20 deletions

View file

@ -16,22 +16,14 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubControllerTest do
end
test "with the relay disabled, it returns 404", %{conn: conn} do
instance =
Application.get_env(:pleroma, :instance)
|> Keyword.put(:allow_relay, false)
Application.put_env(:pleroma, :instance, instance)
Pleroma.Config.put([:instance, :allow_relay], false)
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)
Pleroma.Config.put([:instance, :allow_relay], true)
end
end