diff options
author | Egor Kislitsyn <egor@kislitsyn.com> | 2020-05-05 23:42:18 +0400 |
---|---|---|
committer | Egor Kislitsyn <egor@kislitsyn.com> | 2020-05-05 23:42:24 +0400 |
commit | 332e016bcdbda5dca90d916bc62a9c67544b5323 (patch) | |
tree | 6b36a02994b7772631681c6183bfdffe6deee384 /test/web/mastodon_api/views | |
parent | 6ba25d11973e56008e5d674313421197ff418d6d (diff) | |
download | pleroma-332e016bcdbda5dca90d916bc62a9c67544b5323.tar.gz pleroma-332e016bcdbda5dca90d916bc62a9c67544b5323.zip |
Add OpenAPI spec for ScheduledActivityController
Diffstat (limited to 'test/web/mastodon_api/views')
-rw-r--r-- | test/web/mastodon_api/views/status_view_test.exs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/test/web/mastodon_api/views/status_view_test.exs b/test/web/mastodon_api/views/status_view_test.exs index 6791c2fb0..451723e60 100644 --- a/test/web/mastodon_api/views/status_view_test.exs +++ b/test/web/mastodon_api/views/status_view_test.exs @@ -402,11 +402,17 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do pleroma: %{mime_type: "image/png"} } + api_spec = Pleroma.Web.ApiSpec.spec() + assert expected == StatusView.render("attachment.json", %{attachment: object}) + OpenApiSpex.TestAssertions.assert_schema(expected, "Attachment", api_spec) # If theres a "id", use that instead of the generated one object = Map.put(object, "id", 2) - assert %{id: "2"} = StatusView.render("attachment.json", %{attachment: object}) + result = StatusView.render("attachment.json", %{attachment: object}) + + assert %{id: "2"} = result + OpenApiSpex.TestAssertions.assert_schema(result, "Attachment", api_spec) end test "put the url advertised in the Activity in to the url attribute" do |