change 204 to http.StatusNoContent

This commit is contained in:
Rex Lee(李俊) 2018-07-02 12:04:13 +08:00
parent f1787f6002
commit 64d474b2a2

View File

@ -690,9 +690,9 @@ func TestContextRenderNoContentAsciiJSON(t *testing.T) {
w := httptest.NewRecorder() w := httptest.NewRecorder()
c, _ := CreateTestContext(w) 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.Empty(t, w.Body.String())
assert.Equal(t, "application/json", w.HeaderMap.Get("Content-Type")) assert.Equal(t, "application/json", w.HeaderMap.Get("Content-Type"))
} }