aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoreugenijm <eugenijm@protonmail.com>2019-03-26 21:42:03 +0300
committereugenijm <eugenijm@protonmail.com>2019-03-26 21:53:28 +0300
commit691d1208b5abd5bfb6ff0c1c75a8f315ee0e4500 (patch)
tree8a88a1c19f80f8fcf681858107c2ec751af9766b /test
parentff3b09f6b307fc9f0d10b941f204824f496df2ae (diff)
downloadpleroma-691d1208b5abd5bfb6ff0c1c75a8f315ee0e4500.tar.gz
Add GET /api/v1/apps/verify_credentials
Diffstat (limited to 'test')
-rw-r--r--test/web/mastodon_api/mastodon_api_controller_test.exs20
1 files changed, 20 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 21e88eda9..9c0fdf368 100644
--- a/test/web/mastodon_api/mastodon_api_controller_test.exs
+++ b/test/web/mastodon_api/mastodon_api_controller_test.exs
@@ -332,6 +332,26 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do
assert id == to_string(user.id)
end
+ test "apps/verify_credentials", %{conn: conn} do
+ token = insert(:oauth_token)
+
+ conn =
+ conn
+ |> assign(:user, token.user)
+ |> assign(:token, token)
+ |> get("/api/v1/apps/verify_credentials")
+
+ app = Repo.preload(token, :app).app
+
+ expected = %{
+ "name" => app.client_name,
+ "website" => app.website,
+ "vapid_key" => Pleroma.Web.Push.vapid_config() |> Keyword.get(:public_key)
+ }
+
+ assert expected == json_response(conn, 200)
+ end
+
test "get a status", %{conn: conn} do
activity = insert(:note_activity)