1
0
mirror of https://github.com/labstack/echo.git synced 2025-07-17 01:43:02 +02:00
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana
2015-07-20 19:24:33 -07:00
parent 6da918876f
commit 17c83a01a4
3 changed files with 21 additions and 14 deletions

View File

@ -93,7 +93,7 @@ func TestContext(t *testing.T) {
err = c.JSON(http.StatusOK, user{"1", "Joe"})
if assert.NoError(t, err) {
assert.Equal(t, http.StatusOK, rec.Code)
assert.Equal(t, ApplicationJSON, rec.Header().Get(ContentType))
assert.Equal(t, ApplicationJSONUTF8, rec.Header().Get(ContentType))
assert.Equal(t, userJSON, strings.TrimSpace(rec.Body.String()))
}
@ -104,7 +104,7 @@ func TestContext(t *testing.T) {
err = c.XML(http.StatusOK, user{"1", "Joe"})
if assert.NoError(t, err) {
assert.Equal(t, http.StatusOK, rec.Code)
assert.Equal(t, ApplicationXML, rec.Header().Get(ContentType))
assert.Equal(t, ApplicationXMLUTF8, rec.Header().Get(ContentType))
assert.Equal(t, xml.Header, xml.Header, rec.Body.String())
}
@ -126,7 +126,7 @@ func TestContext(t *testing.T) {
err = c.HTML(http.StatusOK, "Hello, <strong>World!</strong>")
if assert.NoError(t, err) {
assert.Equal(t, http.StatusOK, rec.Code)
assert.Equal(t, TextHTML, rec.Header().Get(ContentType))
assert.Equal(t, TextHTMLUTF8, rec.Header().Get(ContentType))
assert.Equal(t, "Hello, <strong>World!</strong>", rec.Body.String())
}