aboutsummaryrefslogtreecommitdiff
path: root/test/web/mastodon_api/controllers/app_controller_test.exs
diff options
context:
space:
mode:
authorEgor Kislitsyn <egor@kislitsyn.com>2020-06-01 17:38:57 +0400
committerEgor Kislitsyn <egor@kislitsyn.com>2020-06-01 17:38:57 +0400
commit6b84c62d4a51cb17192945d1b67999b2c56a23d2 (patch)
tree53744600bd910bb0a62be6ab5884c6972da2ffce /test/web/mastodon_api/controllers/app_controller_test.exs
parentcb8236cda62cddb72f4320af6347defae44b81ca (diff)
parente96765df6b04fe5e9766271a9c62e559392758b2 (diff)
downloadpleroma-6b84c62d4a51cb17192945d1b67999b2c56a23d2.tar.gz
Merge remote-tracking branch 'origin/develop' into feature/embeddable-posts
Diffstat (limited to 'test/web/mastodon_api/controllers/app_controller_test.exs')
-rw-r--r--test/web/mastodon_api/controllers/app_controller_test.exs8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/web/mastodon_api/controllers/app_controller_test.exs b/test/web/mastodon_api/controllers/app_controller_test.exs
index 77d234d67..a0b8b126c 100644
--- a/test/web/mastodon_api/controllers/app_controller_test.exs
+++ b/test/web/mastodon_api/controllers/app_controller_test.exs
@@ -16,8 +16,7 @@ defmodule Pleroma.Web.MastodonAPI.AppControllerTest do
conn =
conn
- |> assign(:user, token.user)
- |> assign(:token, token)
+ |> put_req_header("authorization", "Bearer #{token.token}")
|> get("/api/v1/apps/verify_credentials")
app = Repo.preload(token, :app).app
@@ -28,7 +27,7 @@ defmodule Pleroma.Web.MastodonAPI.AppControllerTest do
"vapid_key" => Push.vapid_config() |> Keyword.get(:public_key)
}
- assert expected == json_response(conn, 200)
+ assert expected == json_response_and_validate_schema(conn, 200)
end
test "creates an oauth app", %{conn: conn} do
@@ -37,6 +36,7 @@ defmodule Pleroma.Web.MastodonAPI.AppControllerTest do
conn =
conn
+ |> put_req_header("content-type", "application/json")
|> assign(:user, user)
|> post("/api/v1/apps", %{
client_name: app_attrs.client_name,
@@ -55,6 +55,6 @@ defmodule Pleroma.Web.MastodonAPI.AppControllerTest do
"vapid_key" => Push.vapid_config() |> Keyword.get(:public_key)
}
- assert expected == json_response(conn, 200)
+ assert expected == json_response_and_validate_schema(conn, 200)
end
end