diff options
author | Maksim Pechnikov <parallel588@gmail.com> | 2019-12-01 16:18:16 +0300 |
---|---|---|
committer | Maksim Pechnikov <parallel588@gmail.com> | 2019-12-01 16:18:16 +0300 |
commit | 88f7cf51d43181b27db5ff1807d3e706fa336bac (patch) | |
tree | 3c3f8ba3b7685290e26c3582eeba7ba55ca1d10b /test/web/mastodon_api/controllers/account_controller_test.exs | |
parent | 708fd234bdff5423ca6d8003232eca0df231bbc2 (diff) | |
parent | 0d24ab04c5ea779432b4ea174a1d470dac87315d (diff) | |
download | pleroma-88f7cf51d43181b27db5ff1807d3e706fa336bac.tar.gz pleroma-88f7cf51d43181b27db5ff1807d3e706fa336bac.zip |
Merge branch 'develop' into issue/1411
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 |