From 05ff666f997173bda2f7d96bff237da0cf1c8ca5 Mon Sep 17 00:00:00 2001 From: lain Date: Wed, 12 Aug 2020 16:31:00 +0200 Subject: [PATCH] AdminApiControllerTest: Add test that `deleted` users get deactivated. --- test/web/admin_api/controllers/admin_api_controller_test.exs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/web/admin_api/controllers/admin_api_controller_test.exs b/test/web/admin_api/controllers/admin_api_controller_test.exs index eca9272e0..66d4b1ef3 100644 --- a/test/web/admin_api/controllers/admin_api_controller_test.exs +++ b/test/web/admin_api/controllers/admin_api_controller_test.exs @@ -158,6 +158,8 @@ test "single user", %{admin: admin, conn: conn} 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 @@ test "single user", %{admin: admin, conn: conn} 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