Created
March 20, 2014 23:30
-
-
Save chilts/9676306 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return Client.create(config.publicUrl, 'a+b+c@example.com', pwd) | |
.then( | |
function (c) { | |
return c.destroyAccount() | |
}, | |
function (err) { | |
t.equal(err.errno, 101, 'unusual email is not invalid') | |
} | |
) | |
// should be | |
return Client.create(config.publicUrl, 'a+b+c@example.com', pwd) | |
.then( | |
function (c) { | |
t.pass('Weird but valid email address accepted') | |
return c.destroyAccount() | |
}, | |
function (err) { | |
t.fail('Email address ' + email + ' is valid, but was not accepted') | |
} | |
) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We don't care whether the create succeeds or not, we only care that we don't get a validation error. The top one is close to correct, but should really check that errno != 107, but since a 101 means it passed validation its not wrong. The test should not fail in the bottom one unless the errno == 107, but besides that it is ok too.