diff --git a/test/user_test.js b/test/user_test.js index 9bd9f0eef2..9f83778e19 100644 --- a/test/user_test.js +++ b/test/user_test.js @@ -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(); }); });