Tests that no XML is rendered if code is 204
(t *testing.T)
| 1310 | |
| 1311 | // Tests that no XML is rendered if code is 204 |
| 1312 | func TestContextRenderNoContentXML(t *testing.T) { |
| 1313 | w := httptest.NewRecorder() |
| 1314 | c, _ := CreateTestContext(w) |
| 1315 | |
| 1316 | c.XML(http.StatusNoContent, H{"foo": "bar"}) |
| 1317 | |
| 1318 | assert.Equal(t, http.StatusNoContent, w.Code) |
| 1319 | assert.Empty(t, w.Body.String()) |
| 1320 | assert.Equal(t, "application/xml; charset=utf-8", w.Header().Get("Content-Type")) |
| 1321 | } |
| 1322 | |
| 1323 | // TestContextRenderString tests that the response is returned |
| 1324 | // with Content-Type set to text/plain |
nothing calls this directly
no test coverage detected
searching dependent graphs…