diff options
author | Ivan Tashkinov <ivantashkinov@gmail.com> | 2019-12-06 00:26:31 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivantashkinov@gmail.com> | 2019-12-06 00:26:31 +0300 |
commit | 13926537b644c3a4f1904c2fcd5d25fe0f284663 (patch) | |
tree | 713182a80672ab37ad9284ad82b399107f050208 /test/web/mastodon_api/controllers/account_controller_test.exs | |
parent | af42c00cfffb2cd8e93857cd1cf2901113c45bd2 (diff) | |
parent | 228bf4d214abe3bb62c52128d3bc145e396b174d (diff) | |
download | pleroma-13926537b644c3a4f1904c2fcd5d25fe0f284663.tar.gz pleroma-13926537b644c3a4f1904c2fcd5d25fe0f284663.zip |
Merge remote-tracking branch 'remotes/origin/develop' into 1427-oauth-admin-scopes
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 |