Created
March 30, 2016 05:52
-
-
Save colwem/40c9af1054d11c402599b8c0937785fd 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
it('returns errors for both username and password when submitting empty user object', function (done) { | |
var user = User.forge({}); | |
var errors; | |
user.register() | |
.then((function (res) { | |
console.log('supposed to be rejected', res); | |
})) | |
.catch(function (err) { | |
errors = err; | |
console.log('errors', err); | |
should.exist(errors.errors.email.errors[0].rule); | |
errors.errors.email.errors[0].rule.should.equal('required'); | |
should.exist(errors.errors.password.errors[0].rule); | |
errors.errors.password.errors[0].rule.should.equal('required'); | |
}) | |
.then(() => done(), done); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment