X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;ds=sidebyside;f=test%2Ftasks%2Fcount_statuses_test.exs;h=c5cd16960a70055681570b0a4d85d94e7aec3357;hb=878c7f3f309aa5aaa9eababc2c863248dd4420bb;hp=6035da3c31b41988800b1567220f5491b52f20c0;hpb=fd6d05dc45e2fdff56e777431b303fc24ef7912f;p=akkoma
diff --git a/test/tasks/count_statuses_test.exs b/test/tasks/count_statuses_test.exs
index 6035da3c3..c5cd16960 100644
--- a/test/tasks/count_statuses_test.exs
+++ b/test/tasks/count_statuses_test.exs
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2019 Pleroma Authors
+# Copyright © 2017-2020 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Mix.Tasks.Pleroma.CountStatusesTest do
@@ -13,27 +13,27 @@ defmodule Mix.Tasks.Pleroma.CountStatusesTest do
test "counts statuses" do
user = insert(:user)
- {:ok, _} = CommonAPI.post(user, %{"status" => "test"})
- {:ok, _} = CommonAPI.post(user, %{"status" => "test2"})
+ {:ok, _} = CommonAPI.post(user, %{status: "test"})
+ {:ok, _} = CommonAPI.post(user, %{status: "test2"})
user2 = insert(:user)
- {:ok, _} = CommonAPI.post(user2, %{"status" => "test3"})
+ {:ok, _} = CommonAPI.post(user2, %{status: "test3"})
user = refresh_record(user)
user2 = refresh_record(user2)
- assert %{info: %{note_count: 2}} = user
- assert %{info: %{note_count: 1}} = user2
+ assert %{note_count: 2} = user
+ assert %{note_count: 1} = user2
- {:ok, user} = User.update_info(user, &User.Info.set_note_count(&1, 0))
- {:ok, user2} = User.update_info(user2, &User.Info.set_note_count(&1, 0))
+ {:ok, user} = User.update_note_count(user, 0)
+ {:ok, user2} = User.update_note_count(user2, 0)
- assert %{info: %{note_count: 0}} = user
- assert %{info: %{note_count: 0}} = user2
+ assert %{note_count: 0} = user
+ assert %{note_count: 0} = user2
assert capture_io(fn -> Mix.Tasks.Pleroma.CountStatuses.run([]) end) == "Done\n"
- assert %{info: %{note_count: 2}} = refresh_record(user)
- assert %{info: %{note_count: 1}} = refresh_record(user2)
+ assert %{note_count: 2} = refresh_record(user)
+ assert %{note_count: 1} = refresh_record(user2)
end
end