1
0
mirror of https://github.com/labstack/echo.git synced 2025-12-01 22:51:17 +02:00

api changes in context

Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana
2015-04-06 08:09:38 -07:00
parent eed30582ae
commit cff9ce5ae6
2 changed files with 8 additions and 8 deletions

View File

@@ -83,17 +83,17 @@ func TestContext(t *testing.T) {
t.Errorf("render string %v", err)
}
// HTML
// HTML string
r.Header.Set(HeaderAccept, MIMEHTML)
c.Response.committed = false
if err := c.Render(http.StatusOK, "Hello, <strong>World!</strong>"); err != nil {
t.Errorf("render html %v", err)
}
// HTML template
// HTML
c.Response.committed = false
tmpl, _ := template.New("foo").Parse(`{{define "T"}}Hello, {{.}}!{{end}}`)
if err := c.HTMLTemplate(http.StatusOK, tmpl, "T", "Joe"); err != nil {
if err := c.HTML(http.StatusOK, tmpl, "T", "Joe"); err != nil {
t.Errorf("render html template %v", err)
}