X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=test%2Fpleroma%2Fweb%2Fadmin_api%2Fsearch_test.exs;h=b8eeec65b6de8eeb54d5965da3b68c88e379b2a6;hb=fb2a8e7ccd6cfbfb9bc226998a083405fcebcbe0;hp=92a116c659e337fceed074396ed1476af6c7494b;hpb=60663150b5b936c831bdc0cfeade30867e536317;p=akkoma
diff --git a/test/pleroma/web/admin_api/search_test.exs b/test/pleroma/web/admin_api/search_test.exs
index 92a116c65..b8eeec65b 100644
--- a/test/pleroma/web/admin_api/search_test.exs
+++ b/test/pleroma/web/admin_api/search_test.exs
@@ -1,9 +1,9 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors
+# Copyright © 2017-2021 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.AdminAPI.SearchTest do
- use Pleroma.Web.ConnCase
+ use Pleroma.Web.ConnCase, async: true
alias Pleroma.Web.AdminAPI.Search
@@ -47,9 +47,9 @@ defmodule Pleroma.Web.AdminAPI.SearchTest do
end
test "it returns active/deactivated users" do
- insert(:user, deactivated: true)
- insert(:user, deactivated: true)
- insert(:user, deactivated: false)
+ insert(:user, is_active: false)
+ insert(:user, is_active: false)
+ insert(:user, is_active: true)
{:ok, _results, active_count} =
Search.user(%{
@@ -70,7 +70,7 @@ defmodule Pleroma.Web.AdminAPI.SearchTest do
test "it returns specific user" do
insert(:user)
insert(:user)
- user = insert(:user, nickname: "bob", local: true, deactivated: false)
+ user = insert(:user, nickname: "bob", local: true, is_active: true)
{:ok, _results, total_count} = Search.user(%{query: ""})
@@ -182,7 +182,7 @@ defmodule Pleroma.Web.AdminAPI.SearchTest do
end
test "it returns unapproved user" do
- unapproved = insert(:user, approval_pending: true)
+ unapproved = insert(:user, is_approved: false)
insert(:user)
insert(:user)
@@ -193,7 +193,7 @@ defmodule Pleroma.Web.AdminAPI.SearchTest do
end
test "it returns unconfirmed user" do
- unconfirmed = insert(:user, confirmation_pending: true)
+ unconfirmed = insert(:user, is_confirmed: false)
insert(:user)
insert(:user)
@@ -203,6 +203,7 @@ defmodule Pleroma.Web.AdminAPI.SearchTest do
assert count == 1
end
+ # Note: as in Mastodon, `is_discoverable` doesn't anyhow relate to user searchability
test "it returns non-discoverable users" do
insert(:user)
insert(:user, is_discoverable: false)