From c8535fe4a1db6498c3c75b9d8704d1fc3ad2c964 Mon Sep 17 00:00:00 2001 From: Sahat Yalkabov Date: Wed, 26 Feb 2014 02:46:21 -0500 Subject: [PATCH] Moved assertion of code 11000 inside if (err) --- test/user_test.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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(); }); });