mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-22 17:42:14 +08:00
fixed missed code
fixed missed code bug replace 201 with http lib and update annotation
This commit is contained in:
parent
86fe335849
commit
8ba804b5f4
@ -976,7 +976,7 @@ func TestContextRenderProtoBuf(t *testing.T) {
|
||||
protoData, err := proto.Marshal(data)
|
||||
assert.NoError(t, err)
|
||||
|
||||
assert.Equal(t, 201, w.Code)
|
||||
assert.Equal(t, http.StatusCreated, w.Code)
|
||||
assert.Equal(t, string(protoData[:]), w.Body.String())
|
||||
assert.Equal(t, "application/x-protobuf", w.HeaderMap.Get("Content-Type"))
|
||||
}
|
||||
|
@ -280,10 +280,13 @@ func TestRenderProtoBuf(t *testing.T) {
|
||||
(ProtoBuf{data}).WriteContentType(w)
|
||||
protoData, err := proto.Marshal(data)
|
||||
assert.NoError(t, err)
|
||||
(YAML{data}).WriteContentType(w)
|
||||
assert.Equal(t, "application/x-yaml; charset=utf-8", w.Header().Get("Content-Type"))
|
||||
assert.Equal(t, "application/x-protobuf", w.Header().Get("Content-Type"))
|
||||
|
||||
err = (ProtoBuf{data}).Render(w)
|
||||
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, string(protoData[:]), w.Body.String())
|
||||
assert.Equal(t, "application/x-protobuf", w.Header().Get("Content-Type"))
|
||||
}
|
||||
|
||||
func TestRenderXML(t *testing.T) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user