diff options
author | Maksim Pechnikov <parallel588@gmail.com> | 2020-05-06 05:55:39 +0300 |
---|---|---|
committer | Maksim Pechnikov <parallel588@gmail.com> | 2020-05-06 05:55:39 +0300 |
commit | fb38b7339ccb6c3d7a3a07b74a6471a0f38622fe (patch) | |
tree | a6dc7761d53a37be6a1c46af1c3cbc8873ce50d8 /test/web/mastodon_api/views | |
parent | fe7a0d660e357a03558be3a95ddbb8b409ef9a9e (diff) | |
parent | 7612d9403dbaa6741b28dcf427ecad8fd0f70c30 (diff) | |
download | pleroma-fb38b7339ccb6c3d7a3a07b74a6471a0f38622fe.tar.gz pleroma-fb38b7339ccb6c3d7a3a07b74a6471a0f38622fe.zip |
Merge branch 'develop' into issue/1276-2
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 |