Documentation
¶
Index ¶
- func AssertJSONKey(t *testing.T, body []byte, key, want string)
- func AssertStatus(t *testing.T, got, want int)
- func DoRequest(handler http.Handler, method, path string) *httptest.ResponseRecorder
- func NewTestDB(t *testing.T, models ...interface{}) *gorm.DB
- func NewTestRouter(t *testing.T) *router.Router
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertJSONKey ¶
AssertJSONKey fails if the JSON body doesn't contain key with the expected string value.
func AssertStatus ¶
AssertStatus fails if got != want.
func DoRequest ¶
func DoRequest(handler http.Handler, method, path string) *httptest.ResponseRecorder
DoRequest performs an HTTP request against the handler and returns the recorder.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.