diff --git a/main_test.go b/main_test.go index f5d0867e4c682df3795f87b9a67a4cf479664eaa..7aac6edb570cea57cf491e9e81b53792f10edd69 100644 --- a/main_test.go +++ b/main_test.go @@ -8,6 +8,16 @@ import ( "testing" ) +func TestIndex(t *testing.T) { + r, _ := http.NewRequest("GET", "/", nil) + w := httptest.NewRecorder() + app().ServeHTTP(w, r) + + if !strings.Contains(w.Body.String(), "go-httpbin") { + t.Fatalf("expected go-httpbin in index body") + } +} + func TestGet__Basic(t *testing.T) { r, _ := http.NewRequest("GET", "/get", nil) r.Host = "localhost"