package main import ( "fmt" "testing" "github.com/kataras/iris/v12/httptest" ) func TestResponseWriterQuicktemplate(t *testing.T) { baseRawBody := ` Quicktemplate integration with Iris
Header contents here...

%s

%s
` expectedIndexRawBody := fmt.Sprintf(baseRawBody, "Index Page", "This is our index page's body.") name := "yourname" expectedHelloRawBody := fmt.Sprintf(baseRawBody, "Hello World!", "Hello "+name+"!") app := newApp() e := httptest.New(t, app) e.GET("/").Expect().Status(httptest.StatusOK).Body().Equal(expectedIndexRawBody) e.GET("/" + name).Expect().Status(httptest.StatusOK).Body().Equal(expectedHelloRawBody) }