analytics/test/plausible_web/controllers/admin_controller_test.exs
RobertJoonas 4566e6b530
New admin route for displaying usage (#3577)
* add a new crm usage route for admins

* add a test for admin route authorization

* add full_build_only tag
2023-12-06 10:07:07 +00:00

14 lines
387 B
Elixir

defmodule PlausibleWeb.AdminControllerTest do
use PlausibleWeb.ConnCase
describe "GET /crm/auth/user/:user_id/usage" do
setup [:create_user, :log_in]
@tag :full_build_only
test "returns 403 if the logged in user is not a super admin", %{conn: conn} do
conn = get(conn, "/crm/auth/user/1/usage")
assert response(conn, 403) == "Not allowed"
end
end
end