Merge pull request #81 from strongloop/feature/fix-test
Fix the test assertion as the error message is changed.
This commit is contained in:
commit
d39957f095
|
@ -40,11 +40,16 @@ describe('User', function(){
|
|||
|
||||
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();
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue