Skip to content

Commit

Permalink
Moved assertion of code 11000 inside if (err)
Browse files Browse the repository at this point in the history
  • Loading branch information
sahat committed Feb 26, 2014
1 parent 232f91b commit c8535fe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/user_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ describe('User attributes', function() {

it('should not allow users with duplicate emails', function(done) {
user.save(function(err) {
err.code.should.equal(11000);
if (err) {
err.code.should.equal(11000);
}
done();
});
});
Expand Down

0 comments on commit c8535fe

Please sign in to comment.