Merge remote-tracking branch 'pleroma/develop' into feature/disable-account
[akkoma] / test / web / twitter_api / util_controller_test.exs
index 56474447b59cfa1cee948fffb39cb32829c48459..14a8225f097caac84a6c9de636e77357930fa36f 100644 (file)
@@ -251,4 +251,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