Resolve merge conflicts
[akkoma] / test / web / twitter_api / util_controller_test.exs
index 56474447b59cfa1cee948fffb39cb32829c48459..2cd82b3e77839a2d9774030d0ca58db074304e8a 100644 (file)
@@ -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