diff options
author | lain <lain@soykaf.club> | 2019-05-17 12:26:59 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2019-05-17 12:26:59 +0200 |
commit | 412a3d8a0f74ee3a46f9ba98d906c65c6c1c4da8 (patch) | |
tree | d7dc5c61e4b3a01b21e33ccbea3aa4bfffc051aa /test/web/twitter_api/util_controller_test.exs | |
parent | f1e67bdc312ba16a37916024244d6cb9d4417c9e (diff) | |
parent | e5b34f5e0544371603bc2b570c26ede3182c2f8b (diff) | |
download | pleroma-412a3d8a0f74ee3a46f9ba98d906c65c6c1c4da8.tar.gz pleroma-412a3d8a0f74ee3a46f9ba98d906c65c6c1c4da8.zip |
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into rum-index
Diffstat (limited to 'test/web/twitter_api/util_controller_test.exs')
-rw-r--r-- | test/web/twitter_api/util_controller_test.exs | 44 |
1 files changed, 20 insertions, 24 deletions
diff --git a/test/web/twitter_api/util_controller_test.exs b/test/web/twitter_api/util_controller_test.exs index 56474447b..2cd82b3e7 100644 --- a/test/web/twitter_api/util_controller_test.exs +++ b/test/web/twitter_api/util_controller_test.exs @@ -141,7 +141,7 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do test "it returns the managed config", %{conn: conn} do Pleroma.Config.put([:instance, :managed_config], false) - Pleroma.Config.put([:fe], theme: "rei-ayanami-towel") + Pleroma.Config.put([:frontend_configurations, :pleroma_fe], %{theme: "asuka-hospital"}) response = conn @@ -157,29 +157,7 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do |> get("/api/statusnet/config.json") |> json_response(:ok) - assert response["site"]["pleromafe"] - end - - test "if :pleroma, :fe is false, it returns the new style config settings", %{conn: conn} do - Pleroma.Config.put([:instance, :managed_config], true) - Pleroma.Config.put([:fe, :theme], "rei-ayanami-towel") - Pleroma.Config.put([:frontend_configurations, :pleroma_fe], %{theme: "asuka-hospital"}) - - response = - conn - |> get("/api/statusnet/config.json") - |> json_response(:ok) - - assert response["site"]["pleromafe"]["theme"] == "rei-ayanami-towel" - - Pleroma.Config.put([:fe], false) - - response = - conn - |> get("/api/statusnet/config.json") - |> json_response(:ok) - - assert response["site"]["pleromafe"]["theme"] == "asuka-hospital" + assert response["site"]["pleromafe"] == %{"theme" => "asuka-hospital"} end end @@ -251,4 +229,22 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do assert conn.status in [200, 503] end + + describe "POST /api/pleroma/disable_account" do + test "it returns HTTP 200", %{conn: conn} do + user = insert(:user) + + response = + conn + |> assign(:user, user) + |> post("/api/pleroma/disable_account", %{"password" => "test"}) + |> json_response(:ok) + + assert response == %{"status" => "success"} + + user = User.get_cached_by_id(user.id) + + assert user.info.deactivated == true + end + end end |