diff --git a/src/test/users-test.js b/src/test/users-test.js index c7bbc1ecb..b54e43c34 100644 --- a/src/test/users-test.js +++ b/src/test/users-test.js @@ -207,28 +207,6 @@ describe('User', function () { done(); }); }); - - it('succeeds and attempts to send invite to fallbackEmail', function (done) { - // use maildb to not trigger further events - maildb.update(DOMAIN_0.domain, { enabled: true }, function (error) { - expect(error).not.to.be.ok(); - - users.create(USERNAME_1, PASSWORD_1, EMAIL_1, DISPLAY_NAME_1, { sendInvite: true }, AUDIT_SOURCE, function (error, result) { - expect(error).not.to.be.ok(); - expect(result).to.be.ok(); - expect(result.username).to.equal(USERNAME_1.toLowerCase()); - expect(result.email).to.equal(EMAIL_1.toLowerCase()); - expect(result.fallbackEmail).to.equal(EMAIL_1.toLowerCase()); - - // first user is owner, do not send mail to admins - checkMails(1, { sentTo: EMAIL_1.toLowerCase() }, function (error) { - expect(error).not.to.be.ok(); - - maildb.update(DOMAIN_0.domain, { enabled: false }, done); - }); - }); - }); - }); }); describe('getOwner', function() { diff --git a/src/users.js b/src/users.js index d567c8eb5..9e88ae7e1 100644 --- a/src/users.js +++ b/src/users.js @@ -203,8 +203,6 @@ function create(username, password, email, displayName, options, auditSource, ca if (error && error.reason === DatabaseError.ALREADY_EXISTS) return callback(new UsersError(UsersError.ALREADY_EXISTS, error.message)); if (error) return callback(new UsersError(UsersError.INTERNAL_ERROR, error)); - if (options.sendInvite) mailer.sendInvite(user, invitor); - // when this is used to create the owner, then we have to patch the auditSource to contain himself if (isOwner) { auditSource.userId = user.id;