AssertJSON assets a JSON response (ignoring whitespace differences)
(t *testing.T, body string)
| 63 | |
| 64 | // AssertJSON assets a JSON response (ignoring whitespace differences) |
| 65 | func (f *HandlerFuncTest) AssertJSON(t *testing.T, body string) { |
| 66 | b1, err1 := stripJSON([]byte(body)) |
| 67 | b2, err2 := stripJSON(f.Body()) |
| 68 | |
| 69 | if assert.NoError(t, err1) && assert.NoError(t, err2) { |
| 70 | assert.Equal(t, string(b1), string(b2)) |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | // AssertSuccess asserts a successful response |
| 75 | func (f *HandlerFuncTest) AssertSuccess(t *testing.T) { |
no test coverage detected