secret-santa/internal/handlers/user_handler_test.go

21 lines
554 B
Go
Raw Normal View History

2024-11-17 23:35:59 +01:00
package handlers_test
import (
"context"
"git.katuwoss.dev/JustScreaMy/secret-santa/internal/testhelpers"
2024-11-24 11:29:35 +01:00
_ "github.com/jackc/pgx/v5/stdlib"
2024-11-17 23:35:59 +01:00
"github.com/stretchr/testify/assert"
"testing"
)
// TODO: After having ability to configure database connection
func TestHandleGetUsers(t *testing.T) {
ctx := context.Background()
database, err := testhelpers.CreatePostgresContainer(ctx)
2024-11-24 11:29:35 +01:00
t.Log(database.ConnectionString)
2024-11-17 23:35:59 +01:00
assert.NoError(t, err)
2024-11-24 11:29:35 +01:00
err = testhelpers.MigrateDatabase("pgx", "postgres", database.ConnectionString)
2024-11-17 23:35:59 +01:00
assert.NoError(t, err)
}