Documentation
¶
Index ¶
- func AssertAjaxResponse(t *testing.T, w *httptest.ResponseRecorder, status int)
- func AssertBodyContains(t *testing.T, w *httptest.ResponseRecorder, substring string)
- func AssertBodyNotContains(t *testing.T, w *httptest.ResponseRecorder, substring string)
- func AssertHTMLResponse(t *testing.T, w *httptest.ResponseRecorder, status int, contains string)
- func AssertHeader(t *testing.T, w *httptest.ResponseRecorder, header, expectedValue string)
- func AssertJSONResponse(t *testing.T, w *httptest.ResponseRecorder, status int, expectedJSON string)
- func AssertRedirect(t *testing.T, w *httptest.ResponseRecorder, expectedLocation string)
- func AssertStatusCode(t *testing.T, w *httptest.ResponseRecorder, expectedStatus int)
- func AssertTextResponse(t *testing.T, w *httptest.ResponseRecorder, status int, expectedText string)
- func RequireHeader(t *testing.T, w *httptest.ResponseRecorder, header, expectedValue string)
- func RequireStatusCode(t *testing.T, w *httptest.ResponseRecorder, expectedStatus int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertAjaxResponse ¶
func AssertAjaxResponse(t *testing.T, w *httptest.ResponseRecorder, status int)
AssertAjaxResponse asserts that the response is an Ajax partial response. Checks for appropriate headers and partial HTML content.
func AssertBodyContains ¶
func AssertBodyContains(t *testing.T, w *httptest.ResponseRecorder, substring string)
AssertBodyContains asserts that the HTTP response body contains the expected substring.
func AssertBodyNotContains ¶
func AssertBodyNotContains(t *testing.T, w *httptest.ResponseRecorder, substring string)
AssertBodyNotContains asserts that the HTTP response body does not contain the substring.
func AssertHTMLResponse ¶
AssertHTMLResponse asserts that the HTTP response has the expected status code and contains the expected HTML content.
func AssertHeader ¶
func AssertHeader(t *testing.T, w *httptest.ResponseRecorder, header, expectedValue string)
AssertHeader asserts that the HTTP response has the expected header value.
func AssertJSONResponse ¶
func AssertJSONResponse(t *testing.T, w *httptest.ResponseRecorder, status int, expectedJSON string)
AssertJSONResponse asserts that the HTTP response has the expected status code, content type, and JSON body.
func AssertRedirect ¶
func AssertRedirect(t *testing.T, w *httptest.ResponseRecorder, expectedLocation string)
AssertRedirect asserts that the response is a redirect to the expected location.
func AssertStatusCode ¶
func AssertStatusCode(t *testing.T, w *httptest.ResponseRecorder, expectedStatus int)
AssertStatusCode asserts that the HTTP response has the expected status code.
func AssertTextResponse ¶
func AssertTextResponse(t *testing.T, w *httptest.ResponseRecorder, status int, expectedText string)
AssertTextResponse asserts that the HTTP response has the expected status code and text body.
func RequireHeader ¶
func RequireHeader(t *testing.T, w *httptest.ResponseRecorder, header, expectedValue string)
RequireHeader requires that the HTTP response has the expected header value. Fails the test immediately if the header doesn't match.
func RequireStatusCode ¶
func RequireStatusCode(t *testing.T, w *httptest.ResponseRecorder, expectedStatus int)
RequireStatusCode requires that the HTTP response has the expected status code. Fails the test immediately if the status code doesn't match.
Types ¶
This section is empty.