diff options
author | lain <lain@soykaf.club> | 2019-11-21 13:13:14 +0000 |
---|---|---|
committer | lain <lain@soykaf.club> | 2019-11-21 13:13:14 +0000 |
commit | 8feb5dcb4240e92bf20cdc6896877cfa9551b61c (patch) | |
tree | b5d06ca778b0ded2649ba57bc75ce43cb2e0f8db /test/web/mastodon_api/controllers/account_controller_test.exs | |
parent | 1680a3479e4e0b3be5af8db130f8672a063841b0 (diff) | |
parent | e52955c961a225618f00f8f0fc0e7dcbf5a51e23 (diff) | |
download | pleroma-8feb5dcb4240e92bf20cdc6896877cfa9551b61c.tar.gz pleroma-8feb5dcb4240e92bf20cdc6896877cfa9551b61c.zip |
Merge branch 'issue/1348' into 'develop'
[#1348] excluded invisible actors from gets /api/v1/accounts/:id
See merge request pleroma/pleroma!1937
Diffstat (limited to 'test/web/mastodon_api/controllers/account_controller_test.exs')
-rw-r--r-- | test/web/mastodon_api/controllers/account_controller_test.exs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/web/mastodon_api/controllers/account_controller_test.exs b/test/web/mastodon_api/controllers/account_controller_test.exs index 8fc2d9300..585cb8a9e 100644 --- a/test/web/mastodon_api/controllers/account_controller_test.exs +++ b/test/web/mastodon_api/controllers/account_controller_test.exs @@ -8,6 +8,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do alias Pleroma.Repo alias Pleroma.User alias Pleroma.Web.ActivityPub.ActivityPub + alias Pleroma.Web.ActivityPub.InternalFetchActor alias Pleroma.Web.CommonAPI alias Pleroma.Web.OAuth.Token @@ -118,6 +119,28 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do refute acc_one == acc_two assert acc_two == acc_three end + + test "returns 404 when user is invisible", %{conn: conn} do + user = insert(:user, %{invisible: true}) + + resp = + conn + |> get("/api/v1/accounts/#{user.nickname}") + |> json_response(404) + + assert %{"error" => "Can't find user"} = resp + end + + test "returns 404 for internal.fetch actor", %{conn: conn} do + %User{nickname: "internal.fetch"} = InternalFetchActor.get_actor() + + resp = + conn + |> get("/api/v1/accounts/internal.fetch") + |> json_response(404) + + assert %{"error" => "Can't find user"} = resp + end end describe "user timelines" do |