summaryrefslogtreecommitdiff
path: root/test/web/mastodon_api/controllers/account_controller_test.exs
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2019-12-04 16:35:59 +0100
committerlain <lain@soykaf.club>2019-12-04 16:35:59 +0100
commite9993acdbbd1649bbcbf3fb36581b91145fe6055 (patch)
treeb78d91c904e307a504ed91a06ab718d8c694ca5c /test/web/mastodon_api/controllers/account_controller_test.exs
parent1bd1f62af55e01613e6362661b36a19091c87424 (diff)
parent228bf4d214abe3bb62c52128d3bc145e396b174d (diff)
downloadpleroma-e9993acdbbd1649bbcbf3fb36581b91145fe6055.tar.gz
pleroma-e9993acdbbd1649bbcbf3fb36581b91145fe6055.zip
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into remake-remodel
Diffstat (limited to 'test/web/mastodon_api/controllers/account_controller_test.exs')
-rw-r--r--test/web/mastodon_api/controllers/account_controller_test.exs23
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