diff options
author | Ivan Tashkinov <ivant.business@gmail.com> | 2019-03-26 18:13:24 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivant.business@gmail.com> | 2019-03-26 18:13:24 +0300 |
commit | caf0e9cf331dc70b8f055d741bb40bb8bf564f59 (patch) | |
tree | b00af2bd2ac9acfbb66d37132b71fe1d01b5485d | |
parent | eef1042b167e657a80f831b6c3037cc4924d8147 (diff) | |
download | pleroma-caf0e9cf331dc70b8f055d741bb40bb8bf564f59.tar.gz |
Test for MastoAPI /api/v1/instance response structure.
-rw-r--r-- | test/web/mastodon_api/mastodon_api_controller_test.exs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/web/mastodon_api/mastodon_api_controller_test.exs b/test/web/mastodon_api/mastodon_api_controller_test.exs index b2302422b..aa9abe97d 100644 --- a/test/web/mastodon_api/mastodon_api_controller_test.exs +++ b/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}) |