Documentation ¶
Index ¶
- func BodyIs(t *testing.T, r *httptest.ResponseRecorder, expectedBody string)
- func CodeIs(t *testing.T, r *httptest.ResponseRecorder, expectedCode int)
- func ContentEncodingIsGzip(t *testing.T, r *httptest.ResponseRecorder)
- func ContentTypeIsJson(t *testing.T, r *httptest.ResponseRecorder)
- func DecodeJsonPayload(r *httptest.ResponseRecorder, v interface{}) error
- func HeaderIs(t *testing.T, r *httptest.ResponseRecorder, headerKey, expectedValue string)
- func MakeSimpleRequest(method string, urlStr string, payload interface{}) *http.Request
- type Recorded
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CodeIs ¶
func CodeIs(t *testing.T, r *httptest.ResponseRecorder, expectedCode int)
CodeIs compares the rescorded status code
func ContentEncodingIsGzip ¶
func ContentEncodingIsGzip(t *testing.T, r *httptest.ResponseRecorder)
func ContentTypeIsJson ¶
func ContentTypeIsJson(t *testing.T, r *httptest.ResponseRecorder)
func DecodeJsonPayload ¶
func DecodeJsonPayload(r *httptest.ResponseRecorder, v interface{}) error
Types ¶
type Recorded ¶
type Recorded struct { T *testing.T Recorder *httptest.ResponseRecorder }
func RunRequest ¶
RunRequest runs a HTTP request through the given handler
func (*Recorded) ContentEncodingIsGzip ¶
func (rd *Recorded) ContentEncodingIsGzip()
func (*Recorded) ContentTypeIsJson ¶
func (rd *Recorded) ContentTypeIsJson()
func (*Recorded) DecodeJsonPayload ¶
Click to show internal directories.
Click to hide internal directories.