Test that POST /api/pleroma/delete_account purges the user

This commit is contained in:
Alex Gleason 2020-08-18 00:24:28 -05:00
parent dcc8926ff1
commit a0f5eb1a55
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -586,10 +586,16 @@ test "with proper permissions and wrong or missing password", %{conn: conn} 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