Tests that no Custom JSON is rendered if code is 204
(t *testing.T)
| 1151 | |
| 1152 | // Tests that no Custom JSON is rendered if code is 204 |
| 1153 | func TestContextRenderNoContentIndentedJSON(t *testing.T) { |
| 1154 | w := httptest.NewRecorder() |
| 1155 | c, _ := CreateTestContext(w) |
| 1156 | |
| 1157 | c.IndentedJSON(http.StatusNoContent, H{"foo": "bar", "bar": "foo", "nested": H{"foo": "bar"}}) |
| 1158 | |
| 1159 | assert.Equal(t, http.StatusNoContent, w.Code) |
| 1160 | assert.Empty(t, w.Body.String()) |
| 1161 | assert.Equal(t, "application/json; charset=utf-8", w.Header().Get("Content-Type")) |
| 1162 | } |
| 1163 | |
| 1164 | func TestContextClientIPWithMultipleHeaders(t *testing.T) { |
| 1165 | c, _ := CreateTestContext(httptest.NewRecorder()) |
nothing calls this directly
no test coverage detected