diff options
author | lain <lain@soykaf.club> | 2019-11-27 14:48:28 +0100 |
---|---|---|
committer | lain <lain@soykaf.club> | 2019-11-27 14:48:28 +0100 |
commit | 50b152766f3be98bda3c630c3e451e6411053900 (patch) | |
tree | 352863032ff2c6d6ba0e80756e6fe6814e0850df /test/web/mastodon_api | |
parent | f36724efb1fc0806e11b4c0c32a03d1aeee13da6 (diff) | |
parent | ef1718a045065ec800dbd2b60879a28eb82caad8 (diff) | |
download | pleroma-50b152766f3be98bda3c630c3e451e6411053900.tar.gz pleroma-50b152766f3be98bda3c630c3e451e6411053900.zip |
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into bugfix/1442-dont-return-nil-for-following-count
Diffstat (limited to 'test/web/mastodon_api')
-rw-r--r-- | test/web/mastodon_api/views/account_view_test.exs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/web/mastodon_api/views/account_view_test.exs b/test/web/mastodon_api/views/account_view_test.exs index af88841ed..d147079ab 100644 --- a/test/web/mastodon_api/views/account_view_test.exs +++ b/test/web/mastodon_api/views/account_view_test.exs @@ -350,7 +350,8 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do } } - assert expected == AccountView.render("show.json", %{user: user, for: other_user}) + assert expected == + AccountView.render("show.json", %{user: refresh_record(user), for: other_user}) end test "returns the settings store if the requesting user is the represented user and it's requested specifically" do @@ -374,6 +375,14 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do refute result.display_name == "<marquee> username </marquee>" end + test "never display nil user follow counts" do + user = insert(:user, following_count: 0, follower_count: 0) + result = AccountView.render("show.json", %{user: user}) + + assert result.following_count == 0 + assert result.followers_count == 0 + end + describe "hiding follows/following" do test "shows when follows/followers stats are hidden and sets follow/follower count to 0" do user = |