diff options
author | Ivan Tashkinov <ivantashkinov@gmail.com> | 2019-11-21 16:47:52 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivantashkinov@gmail.com> | 2019-11-21 16:47:52 +0300 |
commit | cad9b325e567c9c607c2b1d33c915cc88da716b1 (patch) | |
tree | ed186327c32440517857aba719cba3b059031856 /test/web/mastodon_api/controllers/account_controller_test.exs | |
parent | 81f1c6bc4725f6d97d42ff89f24328ae5b505a2d (diff) | |
parent | 8feb5dcb4240e92bf20cdc6896877cfa9551b61c (diff) | |
download | pleroma-cad9b325e567c9c607c2b1d33c915cc88da716b1.tar.gz pleroma-cad9b325e567c9c607c2b1d33c915cc88da716b1.zip |
Merge remote-tracking branch 'remotes/upstream/develop' into 1335-user-api-id-fields-relations
# Conflicts:
# lib/pleroma/user/search.ex
# test/user_test.exs
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 9ff008a50..444693404 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 |