Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add json ASCII string render #1358

Merged
merged 13 commits into from
Jul 3, 2018
Prev Previous commit
Next Next commit
change 204 to http.StatusNoContent
  • Loading branch information
duguying committed Jul 2, 2018
commit 64d474b2a207e01c425ef7d2dd9dc78267d2844f
4 changes: 2 additions & 2 deletions context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -690,9 +690,9 @@ func TestContextRenderNoContentAsciiJSON(t *testing.T) {
w := httptest.NewRecorder()
c, _ := CreateTestContext(w)

c.AsciiJSON(204, []string{"lang", "Go语言"})
c.AsciiJSON(http.StatusNoContent, []string{"lang", "Go语言"})

assert.Equal(t, 204, w.Code)
assert.Equal(t, http.StatusNoContent, w.Code)
assert.Empty(t, w.Body.String())
assert.Equal(t, "application/json", w.HeaderMap.Get("Content-Type"))
}
Expand Down