diff options
Diffstat (limited to 'test/web/mastodon_api/controllers')
3 files changed, 25 insertions, 2 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 diff --git a/test/web/mastodon_api/controllers/filter_controller_test.exs b/test/web/mastodon_api/controllers/filter_controller_test.exs index 5d5b56c8e..550689788 100644 --- a/test/web/mastodon_api/controllers/filter_controller_test.exs +++ b/test/web/mastodon_api/controllers/filter_controller_test.exs @@ -3,7 +3,7 @@  # SPDX-License-Identifier: AGPL-3.0-only  defmodule Pleroma.Web.MastodonAPI.FilterControllerTest do -  use Pleroma.Web.ConnCase, async: true +  use Pleroma.Web.ConnCase    alias Pleroma.Web.MastodonAPI.FilterView diff --git a/test/web/mastodon_api/controllers/scheduled_activity_controller_test.exs b/test/web/mastodon_api/controllers/scheduled_activity_controller_test.exs index 9ad6a4fa7..ae5fee2bc 100644 --- a/test/web/mastodon_api/controllers/scheduled_activity_controller_test.exs +++ b/test/web/mastodon_api/controllers/scheduled_activity_controller_test.exs @@ -3,7 +3,7 @@  # SPDX-License-Identifier: AGPL-3.0-only  defmodule Pleroma.Web.MastodonAPI.ScheduledActivityControllerTest do -  use Pleroma.Web.ConnCase, async: true +  use Pleroma.Web.ConnCase    alias Pleroma.Repo    alias Pleroma.ScheduledActivity | 
