diff options
author | lain <lain@soykaf.club> | 2018-12-02 17:48:00 +0100 |
---|---|---|
committer | lain <lain@soykaf.club> | 2018-12-02 17:48:00 +0100 |
commit | 2a639de9b30aacd44b8ba648b872ad6cb7ab1d6c (patch) | |
tree | e2170ea4210eb2aa9bceaf24c3f05f83148e0fe7 /test/web/mastodon_api/mastodon_api_controller_test.exs | |
parent | 6be0ab1e55e2e9f0c1e6f937631cfd3da899bc79 (diff) | |
download | pleroma-2a639de9b30aacd44b8ba648b872ad6cb7ab1d6c.tar.gz pleroma-2a639de9b30aacd44b8ba648b872ad6cb7ab1d6c.zip |
MastodonApi: Implement hide_network.
Diffstat (limited to 'test/web/mastodon_api/mastodon_api_controller_test.exs')
-rw-r--r-- | test/web/mastodon_api/mastodon_api_controller_test.exs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/web/mastodon_api/mastodon_api_controller_test.exs b/test/web/mastodon_api/mastodon_api_controller_test.exs index 7042a6ace..9333b709e 100644 --- a/test/web/mastodon_api/mastodon_api_controller_test.exs +++ b/test/web/mastodon_api/mastodon_api_controller_test.exs @@ -1002,6 +1002,18 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do assert id == to_string(user.id) end + test "getting followers, hide_network", %{conn: conn} do + user = insert(:user) + other_user = insert(:user, %{info: %{hide_network: true}}) + {:ok, user} = User.follow(user, other_user) + + conn = + conn + |> get("/api/v1/accounts/#{other_user.id}/followers") + + assert [] == json_response(conn, 200) + end + test "getting following", %{conn: conn} do user = insert(:user) other_user = insert(:user) @@ -1015,6 +1027,18 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do assert id == to_string(other_user.id) end + test "getting following, hide_network", %{conn: conn} do + user = insert(:user, %{info: %{hide_network: true}}) + other_user = insert(:user) + {:ok, user} = User.follow(user, other_user) + + conn = + conn + |> get("/api/v1/accounts/#{user.id}/following") + + assert [] == json_response(conn, 200) + end + test "following / unfollowing a user", %{conn: conn} do user = insert(:user) other_user = insert(:user) |