HTTPBodyContains asserts that a specified handler returns a body that contains a string. require.HTTPBodyContains(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky") Returns whether the assertion was successful (true) or not (false).
(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msgAndArgs ...interface{})
| 674 | // |
| 675 | // Returns whether the assertion was successful (true) or not (false). |
| 676 | func HTTPBodyContains(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msgAndArgs ...interface{}) { |
| 677 | if h, ok := t.(tHelper); ok { |
| 678 | h.Helper() |
| 679 | } |
| 680 | if assert.HTTPBodyContains(t, handler, method, url, values, str, msgAndArgs...) { |
| 681 | return |
| 682 | } |
| 683 | t.FailNow() |
| 684 | } |
| 685 | |
| 686 | // HTTPBodyContainsf asserts that a specified handler returns a |
| 687 | // body that contains a string. |
no test coverage detected