From 23add99f12c6e4442ee2449d42487226ed136721 Mon Sep 17 00:00:00 2001 From: Raymond Feng Date: Wed, 4 Dec 2013 14:41:25 -0800 Subject: [PATCH] Fix the test assertion as the error message is changed. --- test/user.test.js | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/test/user.test.js b/test/user.test.js index ce0b8b21..dee77c69 100644 --- a/test/user.test.js +++ b/test/user.test.js @@ -37,15 +37,20 @@ describe('User', function(){ done(); }); }); - - it('Email is required', function(done) { + + it('Email is required', function (done) { User.create({password: '123'}, function (err) { - assert.deepEqual(err, { name: 'ValidationError', - message: 'Validation error', - statusCode: 400, - codes: { email: [ 'presence', 'format.blank', 'uniqueness' ] }, - context: 'user' }); - + assert.deepEqual(err, {name: "ValidationError", + message: "The Model instance is not valid. See `details` " + + "property of the error object for more info.", + statusCode: 422, + details: { + context: "user", + codes: {email: ["presence", "format.blank", "uniqueness"]}, + messages: {email: ["can't be blank", "is blank", + "Email already exists"]}}} + ); + done(); }); });