Moved assertion of code 11000 inside if (err)
This commit is contained in:
@ -34,7 +34,9 @@ describe('User attributes', function() {
|
|||||||
|
|
||||||
it('should not allow users with duplicate emails', function(done) {
|
it('should not allow users with duplicate emails', function(done) {
|
||||||
user.save(function(err) {
|
user.save(function(err) {
|
||||||
err.code.should.equal(11000);
|
if (err) {
|
||||||
|
err.code.should.equal(11000);
|
||||||
|
}
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user