From 6f90ceb2eda68c5541a584d46868de748077c85d Mon Sep 17 00:00:00 2001 From: lain Date: Sun, 18 Nov 2018 18:46:04 +0100 Subject: [PATCH] Fix follower count test. --- lib/pleroma/user.ex | 2 +- test/user_test.exs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index 3a0f78274..64b6c0aa1 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -222,7 +222,7 @@ defmodule Pleroma.User do ap_followers = followed.follower_address cond do - following?(follower, followed) or info["deactivated"] -> + following?(follower, followed) or info.deactivated -> {:error, "Could not follow user: #{followed.nickname} is already on your list."} deny_follow_blocked and blocks?(followed, follower) -> diff --git a/test/user_test.exs b/test/user_test.exs index 6ef88e492..fdc908dcd 100644 --- a/test/user_test.exs +++ b/test/user_test.exs @@ -34,7 +34,7 @@ defmodule Pleroma.UserTest do user = Repo.get(User, user.id) followed = User.get_by_ap_id(followed.ap_id) - assert followed.info["follower_count"] == 1 + assert followed.info.follower_count == 1 assert User.ap_followers(followed) in user.following end @@ -358,11 +358,11 @@ defmodule Pleroma.UserTest do User.follow(follower, user) - assert user.info["follower_count"] == nil + assert user.info.follower_count == 0 {:ok, user} = User.update_follower_count(user) - assert user.info["follower_count"] == 1 + assert user.info.follower_count == 1 end end @@ -517,7 +517,7 @@ defmodule Pleroma.UserTest do follower = Repo.get(User, follower.id) user = Repo.get(User, user.id) - assert user.info["deactivated"] + assert user.info.deactivated refute User.following?(user, followed) refute User.following?(followed, follower) -- 2.45.2