Test that `POST /api/pleroma/delete_account` purges the user
authorAlex Gleason <alex@alexgleason.me>
Tue, 18 Aug 2020 05:24:28 +0000 (00:24 -0500)
committerAlex Gleason <alex@alexgleason.me>
Tue, 18 Aug 2020 05:24:28 +0000 (00:24 -0500)
test/web/twitter_api/util_controller_test.exs

index 109c1e63766f8ae68837629f45e9832c5dcc3941..354d77b562dff4478febf9f695ed1fb38e666191 100644 (file)
@@ -586,10 +586,16 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do
       end
     end
 
-    test "with proper permissions and valid password", %{conn: conn} do
+    test "with proper permissions and valid password", %{conn: conn, user: user} do
       conn = post(conn, "/api/pleroma/delete_account", %{"password" => "test"})
-
+      ObanHelpers.perform_all()
       assert json_response(conn, 200) == %{"status" => "success"}
+
+      user = User.get_by_id(user.id)
+      assert user.deactivated == true
+      assert user.name == nil
+      assert user.bio == nil
+      assert user.password_hash == nil
     end
   end
 end