package handlers_test import ( "net/http" "net/http/httptest" "testing" "github.com/rede5/gohorsejobs/backend/internal/api/handlers" ) func TestNewAdminHandlers(t *testing.T) { h := handlers.NewAdminHandlers(nil, nil, nil, nil) if h == nil { t.Error("NewAdminHandlers should not return nil") } } func TestListAccessRoles(t *testing.T) { h := handlers.NewAdminHandlers(nil, nil, nil, nil) req := httptest.NewRequest(http.MethodGet, "/api/v1/admin/roles", nil) rr := httptest.NewRecorder() h.ListAccessRoles(rr, req) if rr.Code != http.StatusOK { t.Errorf("Expected status 200, got %d", rr.Code) } if rr.Header().Get("Content-Type") != "application/json" { t.Errorf("Expected Content-Type application/json, got %s", rr.Header().Get("Content-Type")) } }