Некоторые проверки не удались
CI / test (push) Successful in 2m5s
Docker / Build and publish worker image (push) Failing after 31s
27 строки
506 B
Go
27 строки
506 B
Go
// Package factories provides functionality.
|
|
package factories
|
|
|
|
import (
|
|
"github.com/icrowley/fake"
|
|
|
|
"rocketgit.ru/rsmon/worker/app/models"
|
|
)
|
|
|
|
// AccountFactory provides functionality.
|
|
func AccountFactory() models.Account {
|
|
account := models.Account{
|
|
Name: fake.Company(),
|
|
}
|
|
return account
|
|
}
|
|
|
|
// PersistedAccount provides functionality.
|
|
func PersistedAccount() models.Account {
|
|
account := AccountFactory()
|
|
err := models.DB().Save(&account).Error
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return account
|
|
}
|