@ -582,8 +582,8 @@ func TestContextRenderIndentedJSON(t *testing.T) {
|
||||
c.IndentedJSON(201, H{"foo": "bar", "bar": "foo", "nested": H{"foo": "bar"}})
|
||||
|
||||
assert.Equal(t, w.Code, 201)
|
||||
assert.Equal(t, w.Body.String(), "{\n \"bar\": \"foo\",\n \"foo\": \"bar\",\n \"nested\": {\n \"foo\": \"bar\"\n }\n}")
|
||||
assert.Equal(t, w.HeaderMap.Get("Content-Type"), "application/json; charset=utf-8")
|
||||
assert.Equal(t, "{\n \"foo\":\"bar\",\n \"bar\":\"foo\",\n \"nested\":{\n \"foo\":\"bar\"\n }\n}", w.Body.String())
|
||||
assert.Equal(t, "application/json; charset=utf-8", w.HeaderMap.Get("Content-Type"))
|
||||
}
|
||||
|
||||
// Tests that no Custom JSON is rendered if code is 204
|
||||
@ -595,7 +595,7 @@ func TestContextRenderNoContentIndentedJSON(t *testing.T) {
|
||||
|
||||
assert.Equal(t, 204, w.Code)
|
||||
assert.Equal(t, "", w.Body.String())
|
||||
assert.Equal(t, w.HeaderMap.Get("Content-Type"), "application/json; charset=utf-8")
|
||||
assert.Equal(t, "application/json; charset=utf-8", w.HeaderMap.Get("Content-Type"))
|
||||
}
|
||||
|
||||
// Tests that the response is serialized as Secure JSON
|
||||
|
Reference in New Issue
Block a user