X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fpleroma%2Fweb%2Ftwitter_api%2Futil_controller_test.exs;h=bdbc478c367fb0661e3417c3bf07c34b407c5f86;hb=1b49b8efe57256b3f64b4b7e8a1de805ab030814;hp=6d007ab66ff6d5da17782869d9a72d31e1f5c846;hpb=79bc4bcc3cb89bb5860470626df5f02991b95885;p=akkoma diff --git a/test/pleroma/web/twitter_api/util_controller_test.exs b/test/pleroma/web/twitter_api/util_controller_test.exs index 6d007ab66..bdbc478c3 100644 --- a/test/pleroma/web/twitter_api/util_controller_test.exs +++ b/test/pleroma/web/twitter_api/util_controller_test.exs @@ -6,7 +6,6 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do use Pleroma.Web.ConnCase use Oban.Testing, repo: Pleroma.Repo - alias Pleroma.Config alias Pleroma.Tests.ObanHelpers alias Pleroma.User @@ -66,7 +65,7 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do } ] - Config.put(:frontend_configurations, config) + clear_config(:frontend_configurations, config) response = conn @@ -99,7 +98,7 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do setup do: clear_config([:instance, :healthcheck]) test "returns 503 when healthcheck disabled", %{conn: conn} do - Config.put([:instance, :healthcheck], false) + clear_config([:instance, :healthcheck], false) response = conn @@ -110,7 +109,7 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do end test "returns 200 when healthcheck enabled and all ok", %{conn: conn} do - Config.put([:instance, :healthcheck], true) + clear_config([:instance, :healthcheck], true) with_mock Pleroma.Healthcheck, system_info: fn -> %Pleroma.Healthcheck{healthy: true} end do @@ -130,7 +129,7 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do end test "returns 503 when healthcheck enabled and health is false", %{conn: conn} do - Config.put([:instance, :healthcheck], true) + clear_config([:instance, :healthcheck], true) with_mock Pleroma.Healthcheck, system_info: fn -> %Pleroma.Healthcheck{healthy: false} end do @@ -164,7 +163,7 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do user = User.get_cached_by_id(user.id) - assert user.deactivated == true + refute user.is_active end test "with valid permissions and invalid password, it returns an error", %{conn: conn} do @@ -178,7 +177,7 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do assert response == %{"error" => "Invalid password."} user = User.get_cached_by_id(user.id) - refute user.deactivated + assert user.is_active end end @@ -428,7 +427,7 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do assert json_response(conn, 200) == %{"status" => "success"} user = User.get_by_id(user.id) - assert user.deactivated == true + refute user.is_active assert user.name == nil assert user.bio == "" assert user.password_hash == nil