Files
knowledge-governance/internal/httpapi/qa_ops_roles_test.go

15 lines
411 B
Go

package httpapi
import (
"net/http"
"testing"
)
func TestQAOperationsRoleGatePrecedesGenericGETShortcut(t *testing.T) {
for _, path := range []string{"/api/v1/qa-ops/status", "/api/v1/qa-ops/records", "/api/v1/qa-ops/records/some-id"} {
if role := classifyRole(http.MethodGet, path); role != roleAdmin {
t.Fatalf("QA employee data route classified as %s, must require admin: %s", role, path)
}
}
}