summaryrefslogtreecommitdiff
path: root/test/web/twitter_api/util_controller_test.exs
diff options
context:
space:
mode:
authorIvan Tashkinov <ivantashkinov@gmail.com>2019-08-22 20:59:58 +0300
committerIvan Tashkinov <ivantashkinov@gmail.com>2019-08-22 20:59:58 +0300
commit256ff09aa8068166a9f83e3159f060fd4598af76 (patch)
treea5e5efa83241f28d8d241b9d2d95ca4ceaefd286 /test/web/twitter_api/util_controller_test.exs
parent8778c16dac1789eeb6dd51524573163216200b5d (diff)
parent73884441f31092bdb2f509950daf9bd3889a9a8b (diff)
downloadpleroma-256ff09aa8068166a9f83e3159f060fd4598af76.tar.gz
pleroma-256ff09aa8068166a9f83e3159f060fd4598af76.zip
[#1149] Merge remote-tracking branch 'remotes/upstream/develop' into 1149-oban-job-queue
# Conflicts: # lib/pleroma/application.ex # lib/pleroma/scheduled_activity_worker.ex # lib/pleroma/web/federator/retry_queue.ex # lib/pleroma/web/oauth/token/clean_worker.ex # test/user_test.exs # test/web/federator_test.exs
Diffstat (limited to 'test/web/twitter_api/util_controller_test.exs')
-rw-r--r--test/web/twitter_api/util_controller_test.exs28
1 files changed, 5 insertions, 23 deletions
diff --git a/test/web/twitter_api/util_controller_test.exs b/test/web/twitter_api/util_controller_test.exs
index e3f129f72..349122c05 100644
--- a/test/web/twitter_api/util_controller_test.exs
+++ b/test/web/twitter_api/util_controller_test.exs
@@ -16,20 +16,13 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do
setup do
Tesla.Mock.mock(fn env -> apply(HttpRequestMock, :request, [env]) end)
-
- instance_config = Pleroma.Config.get([:instance])
- pleroma_fe = Pleroma.Config.get([:frontend_configurations, :pleroma_fe])
- deny_follow_blocked = Pleroma.Config.get([:user, :deny_follow_blocked])
-
- on_exit(fn ->
- Pleroma.Config.put([:instance], instance_config)
- Pleroma.Config.put([:frontend_configurations, :pleroma_fe], pleroma_fe)
- Pleroma.Config.put([:user, :deny_follow_blocked], deny_follow_blocked)
- end)
-
:ok
end
+ clear_config([:instance])
+ clear_config([:frontend_configurations, :pleroma_fe])
+ clear_config([:user, :deny_follow_blocked])
+
describe "POST /api/pleroma/follow_import" do
test "it returns HTTP 200", %{conn: conn} do
user1 = insert(:user)
@@ -262,7 +255,6 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do
end
test "returns the state of safe_dm_mentions flag", %{conn: conn} do
- option = Pleroma.Config.get([:instance, :safe_dm_mentions])
Pleroma.Config.put([:instance, :safe_dm_mentions], true)
response =
@@ -280,8 +272,6 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do
|> json_response(:ok)
assert response["site"]["safeDMMentionsEnabled"] == "0"
-
- Pleroma.Config.put([:instance, :safe_dm_mentions], option)
end
test "it returns the managed config", %{conn: conn} do
@@ -536,15 +526,7 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do
end
describe "GET /api/pleroma/healthcheck" do
- setup do
- config_healthcheck = Pleroma.Config.get([:instance, :healthcheck])
-
- on_exit(fn ->
- Pleroma.Config.put([:instance, :healthcheck], config_healthcheck)
- end)
-
- :ok
- end
+ clear_config([:instance, :healthcheck])
test "returns 503 when healthcheck disabled", %{conn: conn} do
Pleroma.Config.put([:instance, :healthcheck], false)