trepa/internal/variables/service/variable_test.go

24 lines
601 B
Go

package service
import (
"testing"
"gitea.qpismont.fr/qpismont/trepa/internal/variables/repository"
"gitea.qpismont.fr/qpismont/trepa/test"
"github.com/stretchr/testify/assert"
)
func TestVariableService_GetVariable(t *testing.T) {
db := test.SetupTestDB(t, "../../..")
defer db.Close()
repository := repository.NewRepository(db)
service := NewService(repository)
variable, _ := service.GetVariable("first_account_created")
assert.NotNil(t, variable)
assert.Equal(t, 1, variable.Id)
assert.Equal(t, "first_account_created", variable.Name)
assert.Equal(t, "false", variable.Value)
}