package web import ( "io" "net/http" "net/http/httptest" "strings" "testing" "git.fabledsword.com/bvandeusen/minstrel/internal/config" ) func TestHandler_ServesIndexAtRoot(t *testing.T) { req := httptest.NewRequest(http.MethodGet, "/", nil) rec := httptest.NewRecorder() Handler(config.BrandingConfig{}).ServeHTTP(rec, req) if rec.Code != http.StatusOK { t.Fatalf("status = %d, want 200", rec.Code) } if ct := rec.Header().Get("Content-Type"); !strings.Contains(ct, "text/html") { t.Errorf("Content-Type = %q, want text/html*", ct) } body, _ := io.ReadAll(rec.Body) if !strings.Contains(strings.ToLower(string(body)), "