aides-repo-api/tests/integration/taskservice_create_test.go
Maxim Slipenko 0fb274261f
All checks were successful
Format and Lint / format-check (push) Successful in 3m48s
Format and Lint / test (push) Successful in 3m53s
tests: add incorrect upload test
2024-12-26 20:12:55 +03:00

26 lines
583 B
Go

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