26 lines
582 B
Go
26 lines
582 B
Go
|
package integration
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
|
||
|
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/models"
|
||
|
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/services/taskservice"
|
||
|
"github.com/stretchr/testify/assert"
|
||
|
)
|
||
|
|
||
|
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)
|
||
|
}
|