diff options
| author | lain <lain@soykaf.club> | 2018-12-02 17:35:32 +0100 | 
|---|---|---|
| committer | lain <lain@soykaf.club> | 2018-12-02 17:35:32 +0100 | 
| commit | 6be0ab1e55e2e9f0c1e6f937631cfd3da899bc79 (patch) | |
| tree | e34876b87524bbb9059d957ddc003e593bf89e79 /test | |
| parent | 371d96b1da85960dafea9665b8bc32ba553b1555 (diff) | |
| download | pleroma-6be0ab1e55e2e9f0c1e6f937631cfd3da899bc79.tar.gz pleroma-6be0ab1e55e2e9f0c1e6f937631cfd3da899bc79.zip | |
Hide network in ap.
Diffstat (limited to 'test')
| -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 1c24b348c..d8c5badb8 100644 --- a/test/web/activity_pub/activity_pub_controller_test.exs +++ b/test/web/activity_pub/activity_pub_controller_test.exs @@ -145,6 +145,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) @@ -186,6 +200,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) | 
