소스 검색

Test for MastoAPI /api/v1/instance response structure.

tags/v1.1.4
Ivan Tashkinov 5 년 전
부모
커밋
caf0e9cf33
1개의 변경된 파일21개의 추가작업 그리고 0개의 파일을 삭제
  1. +21
    -0
      test/web/mastodon_api/mastodon_api_controller_test.exs

+ 21
- 0
test/web/mastodon_api/mastodon_api_controller_test.exs 파일 보기

@@ -1808,6 +1808,27 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do
end

test "get instance information", %{conn: conn} do
conn = get(conn, "/api/v1/instance")
assert result = json_response(conn, 200)

# Note: not checking for "max_toot_chars" since it's optional
assert %{
"uri" => _,
"title" => _,
"description" => _,
"version" => _,
"email" => _,
"urls" => %{
"streaming_api" => _
},
"stats" => _,
"thumbnail" => _,
"languages" => _,
"registrations" => _
} = result
end

test "get instance stats", %{conn: conn} do
user = insert(:user, %{local: true})

user2 = insert(:user, %{local: true})


불러오는 중...
취소
저장