AdminApiControllerTest: Add test that `deleted` users get deactivated.
authorlain <lain@soykaf.club>
Wed, 12 Aug 2020 14:31:00 +0000 (16:31 +0200)
committerlain <lain@soykaf.club>
Wed, 12 Aug 2020 14:31:00 +0000 (16:31 +0200)
test/web/admin_api/controllers/admin_api_controller_test.exs

index eca9272e016c4014d815771ea01677a9c81b576b..66d4b1ef36bf03666cf32f4ad9610738aa479be8 100644 (file)
@@ -158,6 +158,8 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do
       user = insert(:user)
       clear_config([:instance, :federating], true)
 
+      refute user.deactivated
+
       with_mock Pleroma.Web.Federator,
         publish: fn _ -> nil end do
         conn =
@@ -176,6 +178,9 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do
 
         assert json_response(conn, 200) == [user.nickname]
 
+        user = Repo.get(User, user.id)
+        assert user.deactivated
+
         assert called(Pleroma.Web.Federator.publish(:_))
       end
     end