(t *testing.T)
| 1630 | } |
| 1631 | |
| 1632 | func TestContextNegotiationWithYAML(t *testing.T) { |
| 1633 | w := httptest.NewRecorder() |
| 1634 | c, _ := CreateTestContext(w) |
| 1635 | c.Request, _ = http.NewRequest(http.MethodPost, "", nil) |
| 1636 | |
| 1637 | c.Negotiate(http.StatusOK, Negotiate{ |
| 1638 | Offered: []string{MIMEYAML, MIMEXML, MIMEJSON, MIMETOML, MIMEYAML2}, |
| 1639 | Data: H{"foo": "bar"}, |
| 1640 | }) |
| 1641 | |
| 1642 | assert.Equal(t, http.StatusOK, w.Code) |
| 1643 | assert.Equal(t, "foo: bar\n", w.Body.String()) |
| 1644 | assert.Equal(t, "application/yaml; charset=utf-8", w.Header().Get("Content-Type")) |
| 1645 | } |
| 1646 | |
| 1647 | func TestContextNegotiationWithTOML(t *testing.T) { |
| 1648 | w := httptest.NewRecorder() |
nothing calls this directly
no test coverage detected