Documentation ¶
Index ¶
- func HTTPBody(handle xhttp.Handle, method, url string, values url.Values) string
- func HTTPBodyContains(t *testing.T, handle xhttp.Handle, method, url string, values url.Values, ...) bool
- func HTTPBodyNotContains(t *testing.T, handle xhttp.Handle, method, url string, values url.Values, ...) bool
- func HTTPError(t *testing.T, handle xhttp.Handle, method, url string, values url.Values) bool
- func HTTPRedirect(t *testing.T, handle xhttp.Handle, method, url string, values url.Values) bool
- func HTTPSuccess(t *testing.T, handle xhttp.Handle, method, url string, values url.Values) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HTTPBody ¶
HTTPBody is a helper that returns HTTP body of the response. It returns empty string if building a new request fails.
func HTTPBodyContains ¶
func HTTPBodyContains(t *testing.T, handle xhttp.Handle, method, url string, values url.Values, str interface{}) bool
HTTPBodyContains asserts that a specified handle returns a body that contains a string.
assert.HTTPBodyContains(t, handle, "/a/b/c", nil, "ok")
Returns whether the assertion was successful (true) or not (false).
func HTTPBodyNotContains ¶
func HTTPBodyNotContains(t *testing.T, handle xhttp.Handle, method, url string, values url.Values, str interface{}) bool
HTTPBodyNotContains asserts that a specified handle returns a body that does not contain a string.
assert.HTTPBodyNotContains(t, handle, "/a/b/c", nil, "no")
Returns whether the assertion was successful (true) or not (false).
func HTTPError ¶
HTTPError asserts that a specified handle returns an error status code.
assert.HTTPError(t, handle, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}}
Returns whether the assertion was successful (true) or not (false).
func HTTPRedirect ¶
HTTPRedirect asserts that a specified handle returns a redirect status code.
assert.HTTPRedirect(t, handle, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}}
Returns whether the assertion was successful (true) or not (false).
func HTTPSuccess ¶
HTTPSuccess asserts that a specified handle returns a success status code.
assert.HTTPSuccess(t, handle, "POST", "/a/b/c", nil)
Returns whether the assertion was successful (true) or not (false).
Types ¶
This section is empty.