[#1940] Added `admin_token` param (as `admin_api_params/0`) to existing Admin API...
[akkoma] / test / web / admin_api / controllers / config_controller_test.exs
index 064ef9bc7cb82224d6b4b5188602d5b2e9f21348..61bc9fd39093616ca0cd4db2361b7950cd03f87d 100644 (file)
@@ -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