aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorIvan Tashkinov <ivantashkinov@gmail.com>2020-07-14 19:31:05 +0300
committerIvan Tashkinov <ivantashkinov@gmail.com>2020-07-14 19:31:05 +0300
commit124b4709dcf12a417f5164e53ef3ba67e538d4c7 (patch)
tree2689239e6811dc170427187c6e7e919b8fea3f7f /test
parentce314e6fe236c7a41535dd8a9a0f097c74c6f1ce (diff)
downloadpleroma-124b4709dcf12a417f5164e53ef3ba67e538d4c7.tar.gz
[#1940] Added `admin_token` param (as `admin_api_params/0`) to existing Admin API OpenAPI operations.
Diffstat (limited to 'test')
-rw-r--r--test/web/admin_api/controllers/config_controller_test.exs8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/web/admin_api/controllers/config_controller_test.exs b/test/web/admin_api/controllers/config_controller_test.exs
index 064ef9bc7..61bc9fd39 100644
--- a/test/web/admin_api/controllers/config_controller_test.exs
+++ b/test/web/admin_api/controllers/config_controller_test.exs
@@ -152,6 +152,14 @@ defmodule Pleroma.Web.AdminAPI.ConfigControllerTest do
assert emoji_val[:groups] == [a: 1, b: 2]
assert assets_val[:mascots] == [a: 1, b: 2]
end
+
+ test "with valid `admin_token` query parameter, skips OAuth scopes check" do
+ clear_config([:admin_token], "password123")
+
+ build_conn()
+ |> get("/api/pleroma/admin/config?admin_token=password123")
+ |> json_response_and_validate_schema(200)
+ end
end
test "POST /api/pleroma/admin/config error", %{conn: conn} do