Add spec for AccountController.show

This commit is contained in:
Egor Kislitsyn 2020-04-07 18:53:12 +04:00
commit 278b3fa0ad
No known key found for this signature in database
GPG key ID: 1B49CB15B71E7805
3 changed files with 32 additions and 4 deletions

View file

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ApiSpec.AccountOperationTest do
use Pleroma.Web.ConnCase, async: true
use Pleroma.Web.ConnCase
alias Pleroma.Web.ApiSpec
alias Pleroma.Web.ApiSpec.Schemas.Account
@ -108,4 +108,18 @@ defmodule Pleroma.Web.ApiSpec.AccountOperationTest do
assert_schema([relationship], "AccountRelationshipsResponse", api_spec)
end
test "/api/v1/accounts/:id produces Account", %{
conn: conn
} do
user = insert(:user)
api_spec = ApiSpec.spec()
assert resp =
conn
|> get("/api/v1/accounts/#{user.id}")
|> json_response(:ok)
assert_schema(resp, "Account", api_spec)
end
end