Documentation
¶
Index ¶
- func CleanupTestDB(t *testing.T, db *sql.DB)
- func CreateTestPasswordResetToken(userID uuid.UUID, tokenHash string) *models.PasswordResetToken
- func CreateTestRefreshToken(userID uuid.UUID, tokenHash string) *models.RefreshToken
- func CreateTestUser(email, name, passwordHash string) *models.User
- func SetupTestDB(t *testing.T) *sql.DB
- func TeardownTestDB(t *testing.T, db *sql.DB)
- type APITestClient
- func (c *APITestClient) DELETE(path string) *httptest.ResponseRecorder
- func (c *APITestClient) GET(path string) *httptest.ResponseRecorder
- func (c *APITestClient) PATCH(path string, body interface{}) *httptest.ResponseRecorder
- func (c *APITestClient) POST(path string, body interface{}) *httptest.ResponseRecorder
- func (c *APITestClient) PUT(path string, body interface{}) *httptest.ResponseRecorder
- func (c *APITestClient) ParseJSON(w *httptest.ResponseRecorder, target interface{})
- func (c *APITestClient) SetAuthToken(token string)
- type TestDBConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTestPasswordResetToken ¶
func CreateTestPasswordResetToken(userID uuid.UUID, tokenHash string) *models.PasswordResetToken
func CreateTestRefreshToken ¶
func CreateTestRefreshToken(userID uuid.UUID, tokenHash string) *models.RefreshToken
func CreateTestUser ¶
Types ¶
type APITestClient ¶
func NewAPITestClient ¶
func NewAPITestClient(t *testing.T, router *gin.Engine) *APITestClient
func (*APITestClient) DELETE ¶
func (c *APITestClient) DELETE(path string) *httptest.ResponseRecorder
func (*APITestClient) GET ¶
func (c *APITestClient) GET(path string) *httptest.ResponseRecorder
func (*APITestClient) PATCH ¶
func (c *APITestClient) PATCH(path string, body interface{}) *httptest.ResponseRecorder
func (*APITestClient) POST ¶
func (c *APITestClient) POST(path string, body interface{}) *httptest.ResponseRecorder
func (*APITestClient) PUT ¶
func (c *APITestClient) PUT(path string, body interface{}) *httptest.ResponseRecorder
func (*APITestClient) ParseJSON ¶
func (c *APITestClient) ParseJSON(w *httptest.ResponseRecorder, target interface{})
func (*APITestClient) SetAuthToken ¶
func (c *APITestClient) SetAuthToken(token string)
type TestDBConfig ¶
func DefaultTestDBConfig ¶
func DefaultTestDBConfig() TestDBConfig
Click to show internal directories.
Click to hide internal directories.