diff options
author | Ivan Tashkinov <ivantashkinov@gmail.com> | 2020-04-22 20:00:51 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivantashkinov@gmail.com> | 2020-04-22 20:00:51 +0300 |
commit | e7fb593d130e0ad62e3690dce4a0913fe3d40ef0 (patch) | |
tree | 8edbc679acda1e5e024884c12cbceb2509417033 /test/web/mastodon_api/controllers/custom_emoji_controller_test.exs | |
parent | b03aeae8b935b0a211c51cc3be5f1c15591f5a2f (diff) | |
parent | 28f8fcf8b034223209ec451d0c2c836124ec93f4 (diff) | |
download | pleroma-e7fb593d130e0ad62e3690dce4a0913fe3d40ef0.tar.gz pleroma-e7fb593d130e0ad62e3690dce4a0913fe3d40ef0.zip |
Merge remote-tracking branch 'remotes/origin/develop' into 1364-no-pushes-from-blocked-domains-users
# Conflicts:
# CHANGELOG.md
Diffstat (limited to 'test/web/mastodon_api/controllers/custom_emoji_controller_test.exs')
-rw-r--r-- | test/web/mastodon_api/controllers/custom_emoji_controller_test.exs | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/test/web/mastodon_api/controllers/custom_emoji_controller_test.exs b/test/web/mastodon_api/controllers/custom_emoji_controller_test.exs index 6567a0667..0b2ffa470 100644 --- a/test/web/mastodon_api/controllers/custom_emoji_controller_test.exs +++ b/test/web/mastodon_api/controllers/custom_emoji_controller_test.exs @@ -4,13 +4,18 @@ defmodule Pleroma.Web.MastodonAPI.CustomEmojiControllerTest do use Pleroma.Web.ConnCase, async: true + alias Pleroma.Web.ApiSpec + alias Pleroma.Web.ApiSpec.Schemas.CustomEmoji + alias Pleroma.Web.ApiSpec.Schemas.CustomEmojisResponse + import OpenApiSpex.TestAssertions test "with tags", %{conn: conn} do - [emoji | _body] = - conn - |> get("/api/v1/custom_emojis") - |> json_response(200) + assert resp = + conn + |> get("/api/v1/custom_emojis") + |> json_response(200) + assert [emoji | _body] = resp assert Map.has_key?(emoji, "shortcode") assert Map.has_key?(emoji, "static_url") assert Map.has_key?(emoji, "tags") @@ -18,5 +23,19 @@ defmodule Pleroma.Web.MastodonAPI.CustomEmojiControllerTest do assert Map.has_key?(emoji, "category") assert Map.has_key?(emoji, "url") assert Map.has_key?(emoji, "visible_in_picker") + assert_schema(resp, "CustomEmojisResponse", ApiSpec.spec()) + assert_schema(emoji, "CustomEmoji", ApiSpec.spec()) + end + + test "CustomEmoji example matches schema" do + api_spec = ApiSpec.spec() + schema = CustomEmoji.schema() + assert_schema(schema.example, "CustomEmoji", api_spec) + end + + test "CustomEmojisResponse example matches schema" do + api_spec = ApiSpec.spec() + schema = CustomEmojisResponse.schema() + assert_schema(schema.example, "CustomEmojisResponse", api_spec) end end |