X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;ds=sidebyside;f=test%2Ftasks%2Fdatabase_test.exs;h=7b05993d318ff19be76206ef89263b60e778cdf2;hb=736fead494f6140871919308e872bb6fe5b7a196;hp=bf5ba7883504612e7c103cdd8afeae196da6f49e;hpb=4ea1a61b008c932bc83fcd6cd07bb7f4c251204a;p=akkoma
diff --git a/test/tasks/database_test.exs b/test/tasks/database_test.exs
index bf5ba7883..7b05993d3 100644
--- a/test/tasks/database_test.exs
+++ b/test/tasks/database_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.DatabaseTest do
@@ -72,26 +72,26 @@ defmodule Mix.Tasks.Pleroma.DatabaseTest do
describe "running update_users_following_followers_counts" do
test "following and followers count are updated" do
[user, user2] = insert_pair(:user)
- {:ok, %User{info: info} = user} = User.follow(user, user2)
+ {:ok, %User{} = user} = User.follow(user, user2)
following = User.following(user)
assert length(following) == 2
- assert info.follower_count == 0
+ assert user.follower_count == 0
{:ok, user} =
user
- |> User.change_info(&Ecto.Changeset.change(&1, %{follower_count: 3}))
+ |> Ecto.Changeset.change(%{follower_count: 3})
|> Repo.update()
- assert user.info.follower_count == 3
+ assert user.follower_count == 3
assert :ok == Mix.Tasks.Pleroma.Database.run(["update_users_following_followers_counts"])
user = User.get_by_id(user.id)
assert length(User.following(user)) == 2
- assert user.info.follower_count == 0
+ assert user.follower_count == 0
end
end
@@ -102,7 +102,7 @@ defmodule Mix.Tasks.Pleroma.DatabaseTest do
{:ok, %{id: id, object: object}} = CommonAPI.post(user, %{"status" => "test"})
{:ok, %{object: object2}} = CommonAPI.post(user, %{"status" => "test test"})
- CommonAPI.favorite(id, user2)
+ CommonAPI.favorite(user2, id)
likes = %{
"first" =>