(t *testing.T)
| 193 | } |
| 194 | |
| 195 | func TestContextHTML(t *testing.T) { |
| 196 | rec := httptest.NewRecorder() |
| 197 | req := httptest.NewRequest(http.MethodGet, "/", nil) |
| 198 | c := NewContext(req, rec) |
| 199 | |
| 200 | err := c.HTML(http.StatusOK, "Hi, Jon Snow") |
| 201 | if assert.NoError(t, err) { |
| 202 | assert.Equal(t, http.StatusOK, rec.Code) |
| 203 | assert.Equal(t, MIMETextHTMLCharsetUTF8, rec.Header().Get(HeaderContentType)) |
| 204 | assert.Equal(t, "Hi, Jon Snow", rec.Body.String()) |
| 205 | } |
| 206 | } |
| 207 | |
| 208 | func TestContextHTMLBlob(t *testing.T) { |
| 209 | rec := httptest.NewRecorder() |
nothing calls this directly
no test coverage detected
searching dependent graphs…