26 lines
581 B
Go
26 lines
581 B
Go
package integration
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"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"
|
|
)
|
|
|
|
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)
|
|
}
|