trepa/internal/variables/repository/variable_test.go

20 lines
468 B
Go

package repository
import (
"testing"
"gitea.qpismont.fr/qpismont/trepa/test"
"github.com/stretchr/testify/assert"
)
func TestVariableRepository_FetchOneByName(t *testing.T) {
db := test.SetupTestDB(t, "../../..")
defer db.Close()
repository := NewRepository(db)
variable, err := repository.FetchOneByName("first_account_created")
assert.NoError(t, err)
assert.Equal(t, "first_account_created", variable.Name)
assert.Equal(t, "false", variable.Value)
}