Documentation
¶
Index ¶
- func AuthenticateHttpRequest(t *testing.T, req *http.Request, user models.User)
- func ClearCache() error
- func ClearDB(db *gorm.DB) error
- func CreateRequestWithJSONBody(t *testing.T, url, method string, body interface{}) *http.Request
- func SetupDBForTests() error
- func WithSetupAndTearDownTestEnvironment(t *testing.T, testFunc func(t *testing.T))
- type MockEnqueuer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthenticateHttpRequest ¶
Authenticate an http request
func ClearCache ¶ added in v0.0.54
func ClearCache() error
Remove all items from cache, this function removes: - ratelimit keys
func CreateRequestWithJSONBody ¶
Create an http request with a json serialized body
func SetupDBForTests ¶
func SetupDBForTests() error
SetupDBForTests initializes the database with necessary data for tests
func WithSetupAndTearDownTestEnvironment ¶
Helper function that wraps a test function with setup and teardown of the test environment The setup is done before calling the test function, it initializes the db and clears its contents The teardown is done after the test function returns, it clears the db contents and closes the db connection If setup or teardown fail, the test will fail immediately
Types ¶
Click to show internal directories.
Click to hide internal directories.