diff options
| author | Rin Toshaka <rinpatch@sdf.org> | 2018-12-06 18:11:22 +0100 |
|---|---|---|
| committer | Rin Toshaka <rinpatch@sdf.org> | 2018-12-06 18:11:22 +0100 |
| commit | 88f92693f25c34f8ab82d4ed809b266bf5fb9ff8 (patch) | |
| tree | d6115e451d0cd98672669c6ba93921f75f21e16a /test/web/activity_pub | |
| parent | ca7b46fb3ba576fb7e67eba02654e6df9299392a (diff) | |
| parent | 1d531fd2f32a7f8fff562a3122b30b8ccdccead0 (diff) | |
| download | pleroma-88f92693f25c34f8ab82d4ed809b266bf5fb9ff8.tar.gz pleroma-88f92693f25c34f8ab82d4ed809b266bf5fb9ff8.zip | |
Merge develop
Diffstat (limited to 'test/web/activity_pub')
| -rw-r--r-- | test/web/activity_pub/activity_pub_controller_test.exs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/web/activity_pub/activity_pub_controller_test.exs b/test/web/activity_pub/activity_pub_controller_test.exs index 980f43553..b4af2df5a 100644 --- a/test/web/activity_pub/activity_pub_controller_test.exs +++ b/test/web/activity_pub/activity_pub_controller_test.exs @@ -150,6 +150,20 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubControllerTest do assert result["first"]["orderedItems"] == [user.ap_id] end + test "it returns returns empty if the user has 'hide_network' set", %{conn: conn} do + user = insert(:user) + user_two = insert(:user, %{info: %{hide_network: true}}) + User.follow(user, user_two) + + result = + conn + |> get("/users/#{user_two.nickname}/followers") + |> json_response(200) + + assert result["first"]["orderedItems"] == [] + assert result["totalItems"] == 1 + end + test "it works for more than 10 users", %{conn: conn} do user = insert(:user) @@ -191,6 +205,20 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubControllerTest do assert result["first"]["orderedItems"] == [user_two.ap_id] end + test "it returns returns empty if the user has 'hide_network' set", %{conn: conn} do + user = insert(:user, %{info: %{hide_network: true}}) + user_two = insert(:user) + User.follow(user, user_two) + + result = + conn + |> get("/users/#{user.nickname}/following") + |> json_response(200) + + assert result["first"]["orderedItems"] == [] + assert result["totalItems"] == 1 + end + test "it works for more than 10 users", %{conn: conn} do user = insert(:user) |
