mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-23 10:02:10 +08:00
change 204 to http.StatusNoContent
This commit is contained in:
parent
f1787f6002
commit
64d474b2a2
@ -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"))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user