Documentation ¶
Index ¶
- func DoTestRequest(t *testing.T, method string, slug string, body string, header http.Header) (*http.Response, error)
- func InvokeAndCheck(t *testing.T, handler martini.Handler, i *Injector, expectedStatus int, ...)
- func Ping() martini.Handler
- func VerifyResponse(t *testing.T, res *http.Response, err error, expectedStatus int) []byte
- func VerifyResponseBody(t *testing.T, res *http.Response, err error, expectedStatus int, ...)
- type Injector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoTestRequest ¶
func DoTestRequest(t *testing.T, method string, slug string, body string, header http.Header) (*http.Response, error)
DoTestRequest will execute a request againt the service specified in the SERVICE_HOST env var
func InvokeAndCheck ¶
func InvokeAndCheck(t *testing.T, handler martini.Handler, i *Injector, expectedStatus int, expectedBody []byte)
InvokeAndCheck will invoke a handler with the provided injector and check its return values
func VerifyResponse ¶
VerifyResponse will make sure that the response matches the expected status
Types ¶
type Injector ¶
Injector is a testing helper that can invoke martini handlers
func NewInjector ¶
NewInjector creates a TestInjector
func (*Injector) SetHeaders ¶
SetHeaders sets the headers on the internal request
func (*Injector) SetQueryParams ¶
SetQueryParams will set URL Query parameters on the request
Click to show internal directories.
Click to hide internal directories.