AdminAPI: Filter users by need_approval

This commit is contained in:
Alex Gleason 2020-07-14 14:14:43 -05:00
commit 33f1b29b2c
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7
5 changed files with 56 additions and 1 deletions

View file

@ -166,5 +166,16 @@ defmodule Pleroma.Web.AdminAPI.SearchTest do
assert total == 3
assert count == 1
end
test "it returns unapproved user" do
unapproved = insert(:user, approval_pending: true)
insert(:user)
insert(:user)
{:ok, _results, total} = Search.user()
{:ok, [^unapproved], count} = Search.user(%{need_approval: true})
assert total == 3
assert count == 1
end
end
end