Documentation
¶
Index ¶
- Constants
- func AssertHTTPStatus(t *testing.T, expected int, r *httptest.ResponseRecorder)
- func DecodeError(t *testing.T, s []byte) string
- func DecodeResponse(t *testing.T, r *httptest.ResponseRecorder, target interface{})
- func Request(t *testing.T, method, url string, body any, headers ...map[string]string) httptest.ResponseRecorder
- type APIResponse
Constants ¶
View Source
const TOLERANCE time.Duration = 1000000000 * 60
TOLERANCE is the number of seconds that a CreatedAt or UpdatedAt time.Time is allowed to differ from the time at which it is checked.
As CreatedAt and UpdatedAt are automatically set by gorm, we need a tolerance here. This is in nanoseconds, so we multiply by 1000000000 for seconds.
Variables ¶
This section is empty.
Functions ¶
func AssertHTTPStatus ¶
func AssertHTTPStatus(t *testing.T, expected int, r *httptest.ResponseRecorder)
func DecodeResponse ¶
func DecodeResponse(t *testing.T, r *httptest.ResponseRecorder, target interface{})
DecodeResponse decodes an HTTP response into a target struct.
Types ¶
type APIResponse ¶
Click to show internal directories.
Click to hide internal directories.