Skip to content

Commit

Permalink
Remove email stubbing code that wasn’t safe for running multiple time…
Browse files Browse the repository at this point in the history
…s on the server.
  • Loading branch information
n1mmy committed Dec 5, 2013
1 parent 1bd2976 commit d1cb374
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions packages/accounts-password/password_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -488,18 +488,14 @@ if (Meteor.isServer) (function () {
Tinytest.add(
'passwords - createUser hooks',
function (test) {
var email = Random.id() + '@example.com';
var username = Random.id();
test.throws(function () {
// should fail the new user validators
Accounts.createUser({email: email, profile: {invalid: true}});
});
Accounts.createUser({username: username, profile: {invalid: true}});
});

// disable sending emails
var oldEmailSend = Email.send;
Email.send = function() {};
var userId = Accounts.createUser({email: email,
var userId = Accounts.createUser({username: username,
testOnCreateUserHook: true});
Email.send = oldEmailSend;

test.isTrue(userId);
var user = Meteor.users.findOne(userId);
Expand Down

0 comments on commit d1cb374

Please sign in to comment.