summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Gleason <alex@alexgleason.me>2021-12-27 18:52:34 -0600
committerAlex Gleason <alex@alexgleason.me>2021-12-27 18:52:34 -0600
commit5c80d4087df2f6a8436af87ad109eb9e3bd4e3c1 (patch)
tree304afdfc47f99e501cbf1b00cbf3376ece3f9a7e
parent7704a722c06c9658d4037167dc5b6f01a4582b14 (diff)
PleromaAPI.AppView: add test
-rw-r--r--test/pleroma/web/pleroma_api/views/app_view_test.exs21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/pleroma/web/pleroma_api/views/app_view_test.exs b/test/pleroma/web/pleroma_api/views/app_view_test.exs
new file mode 100644
index 000000000..f0aee6987
--- /dev/null
+++ b/test/pleroma/web/pleroma_api/views/app_view_test.exs
@@ -0,0 +1,21 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Pleroma.Web.PleromaAPI.AppViewTest do
+ use Pleroma.DataCase, async: true
+ alias Pleroma.Web.PleromaAPI.AppView
+ import Pleroma.Factory
+
+ test "index.json" do
+ apps = [
+ insert(:oauth_app),
+ insert(:oauth_app),
+ insert(:oauth_app)
+ ]
+
+ results = AppView.render("index.json", %{apps: apps})
+
+ assert [%{client_id: _, client_secret: _}, _, _] = results
+ end
+end