diff options
author | href <href@random.sh> | 2018-11-06 16:00:48 +0100 |
---|---|---|
committer | href <href@random.sh> | 2018-11-06 16:00:48 +0100 |
commit | 7d328c658da69ec236d10fa89d23f2a6886b3205 (patch) | |
tree | ef0f639fe4c57cf9160d0e69e2918461ecf9a008 /test/web | |
parent | 36ca3c1b3ec814609d14815a672239a31b1e0ec5 (diff) | |
download | pleroma-7d328c658da69ec236d10fa89d23f2a6886b3205.tar.gz pleroma-7d328c658da69ec236d10fa89d23f2a6886b3205.zip |
Small wrapper module around Application.get_env/put_env
Same API as the old Pleroma.Config
Diffstat (limited to 'test/web')
-rw-r--r-- | test/web/activity_pub/activity_pub_controller_test.exs | 12 | ||||
-rw-r--r-- | test/web/federator_test.exs | 12 |
2 files changed, 4 insertions, 20 deletions
diff --git a/test/web/activity_pub/activity_pub_controller_test.exs b/test/web/activity_pub/activity_pub_controller_test.exs index f22975f86..1c24b348c 100644 --- a/test/web/activity_pub/activity_pub_controller_test.exs +++ b/test/web/activity_pub/activity_pub_controller_test.exs @@ -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 diff --git a/test/web/federator_test.exs b/test/web/federator_test.exs index 88aef0d0f..c709d1181 100644 --- a/test/web/federator_test.exs +++ b/test/web/federator_test.exs @@ -50,11 +50,7 @@ defmodule Pleroma.Web.FederatorTest do activity: activity, relay_mock: relay_mock } 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) with_mocks([relay_mock]) do Federator.handle(:publish, activity) @@ -62,11 +58,7 @@ defmodule Pleroma.Web.FederatorTest do refute_received :relay_publish - 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 end |