github.com/bketelsen/buffalo@v0.9.5/generators/newapp/templates/actions/home_test.go.tmpl (about)

     1  package actions
     2  
     3  func (as *ActionSuite) Test_HomeHandler() {
     4    {{ if .asWeb -}}
     5  	res := as.HTML("/").Get()
     6    {{ end -}}
     7    {{ if .asAPI -}}
     8  	res := as.JSON("/").Get()
     9    {{ end -}}
    10  
    11  	as.Equal(200, res.Code)
    12  	as.Contains(res.Body.String(), "Welcome to Buffalo")
    13  }