1 defmodule Pleroma.Web.AkkomaAPI.MetricsControllerTest do
2 use Pleroma.Web.ConnCase, async: true
5 alias Pleroma.Akkoma.FrontendSettingsProfile
7 describe "GET /api/v1/akkoma/metrics" do
8 test "should return metrics when the user has admin:metrics" do
9 %{conn: conn} = oauth_access(["admin:metrics"])
11 |> get("/api/v1/akkoma/metrics")
14 assert resp =~ "# HELP"
17 test "should not allow users that do not have the admin:metrics scope" do
18 %{conn: conn} = oauth_access(["read:metrics"])
20 |> get("/api/v1/akkoma/metrics")