more tests
authorEgor Kislitsyn <egor@kislitsyn.com>
Fri, 12 Apr 2019 09:51:28 +0000 (16:51 +0700)
committerEgor Kislitsyn <egor@kislitsyn.com>
Fri, 12 Apr 2019 09:51:28 +0000 (16:51 +0700)
test/web/twitter_api/util_controller_test.exs

index a4b3d651af1a2b5a491e90a3a1744d15431fec10..66d89eee0bd0c0356b9a0699635cde14123a2230 100644 (file)
@@ -230,4 +230,22 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do
       assert html_response(response, 200) =~ "Log in to follow"
     end
   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