auto mail generation
This commit is contained in:
@@ -93,7 +93,7 @@ func (r *recordingUserRepo) GetUserById(uid int) (models.UserInfo, error) {
|
||||
|
||||
func TestCreateUserActuallyPreparesTheAccount(t *testing.T) {
|
||||
repo := &recordingUserRepo{}
|
||||
if _, err := NewUserService(repo).CreateUser(models.User{
|
||||
if _, _, err := NewUserService(repo, nil).CreateUser(models.User{
|
||||
Email: "thiruomart@gmail.com",
|
||||
}); err != nil {
|
||||
t.Fatalf("CreateUser: %v", err)
|
||||
@@ -114,16 +114,16 @@ type recordingTenantRepo struct {
|
||||
created models.User
|
||||
}
|
||||
|
||||
func (r *recordingTenantRepo) CreateStaff(user models.User) error {
|
||||
func (r *recordingTenantRepo) CreateStaff(user models.User) (int, error) {
|
||||
r.created = user
|
||||
return nil
|
||||
return 5150, nil
|
||||
}
|
||||
|
||||
// The other creation path. Both make back-office accounts, so both have to
|
||||
// prepare them — and only one of them did.
|
||||
func TestCreateStaffActuallyPreparesTheAccount(t *testing.T) {
|
||||
repo := &recordingTenantRepo{}
|
||||
if err := NewTenantService(repo).CreateStaff(models.User{Email: "suriya@example.com"}); err != nil {
|
||||
if _, err := NewTenantService(repo, nil).CreateStaff(models.User{Email: "suriya@example.com"}); err != nil {
|
||||
t.Fatalf("CreateStaff: %v", err)
|
||||
}
|
||||
if repo.created.Authname != "suriya@example.com" || repo.created.Configid != ConsoleConfigID {
|
||||
|
||||
Reference in New Issue
Block a user