AdminApiControllerTest: Add test that deleted users get deactivated.

This commit is contained in:
lain 2020-08-12 16:31:00 +02:00
parent 86c18e4165
commit 05ff666f99

View file

@ -158,6 +158,8 @@ test "single user", %{admin: admin, conn: conn} do
user = insert(:user) user = insert(:user)
clear_config([:instance, :federating], true) clear_config([:instance, :federating], true)
refute user.deactivated
with_mock Pleroma.Web.Federator, with_mock Pleroma.Web.Federator,
publish: fn _ -> nil end do publish: fn _ -> nil end do
conn = conn =
@ -176,6 +178,9 @@ test "single user", %{admin: admin, conn: conn} do
assert json_response(conn, 200) == [user.nickname] assert json_response(conn, 200) == [user.nickname]
user = Repo.get(User, user.id)
assert user.deactivated
assert called(Pleroma.Web.Federator.publish(:_)) assert called(Pleroma.Web.Federator.publish(:_))
end end
end end