HTTPRedirect asserts that a specified handler returns a redirect status code. require.HTTPRedirect(t, myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} Returns whether the assertion was successful (true) or not (false).
(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{})
| 767 | // |
| 768 | // Returns whether the assertion was successful (true) or not (false). |
| 769 | func HTTPRedirect(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) { |
| 770 | if h, ok := t.(tHelper); ok { |
| 771 | h.Helper() |
| 772 | } |
| 773 | if assert.HTTPRedirect(t, handler, method, url, values, msgAndArgs...) { |
| 774 | return |
| 775 | } |
| 776 | t.FailNow() |
| 777 | } |
| 778 | |
| 779 | // HTTPRedirectf asserts that a specified handler returns a redirect status code. |
| 780 | // |
no test coverage detected