aides-repo-api/tests/integration/taskservice_create_test.go

27 lines
581 B
Go
Raw Permalink Normal View History

2024-12-26 16:20:54 +00:00
package integration
import (
"testing"
2024-12-26 17:12:55 +00:00
"github.com/stretchr/testify/assert"
"code.aides.space/aides-infra/aides-repo-api/internal/models"
"code.aides.space/aides-infra/aides-repo-api/internal/services/taskservice"
2024-12-26 16:20:54 +00:00
)
func TestTaskService_Create(t *testing.T) {
db := prepareDb(t)
config := prepareConfig()
service := taskservice.New(db, config)
repoName := "example-foo"
task, err := service.Create(repoName)
assert.NoError(t, err)
assert.Equal(t, uint(1), task.ID)
assert.Equal(t, repoName, task.Repo.Name)
assert.Equal(t, models.StatusPending, task.Status)
}