diff options
author | lain <lain@soykaf.club> | 2020-04-22 15:31:37 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-04-22 15:31:37 +0200 |
commit | 8b88e2a6e2b3a777ca99bf94676ab47f2d4cc0ea (patch) | |
tree | ee8c578486dcfc746af741886a470512fd9868d6 /test | |
parent | 69ecc3903800685e87eb11cd6063b525aa968316 (diff) | |
download | pleroma-8b88e2a6e2b3a777ca99bf94676ab47f2d4cc0ea.tar.gz |
Stats: Ignore internal users for user count.
Diffstat (limited to 'test')
-rw-r--r-- | test/stats_test.exs (renamed from test/stat_test.exs) | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/test/stat_test.exs b/test/stats_test.exs index bccc1c8d0..73c7c1495 100644 --- a/test/stat_test.exs +++ b/test/stats_test.exs @@ -2,11 +2,22 @@ # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/> # SPDX-License-Identifier: AGPL-3.0-only -defmodule Pleroma.StateTest do +defmodule Pleroma.StatsTest do use Pleroma.DataCase import Pleroma.Factory alias Pleroma.Web.CommonAPI + describe "user count" do + test "it ignores internal users" do + _user = insert(:user, local: true) + _internal = insert(:user, local: true, nickname: nil) + _internal = insert(:user, local: true, nickname: "internal.dude") + _internal = Pleroma.Web.ActivityPub.Relay.get_actor() + + assert match?(%{stats: %{user_count: 1}}, Pleroma.Stats.calculate_stat_data()) + end + end + describe "status visibility count" do test "on new status" do user = insert(:user) |