Fix the test assertion as the error message is changed.
This commit is contained in:
parent
34405df2cb
commit
23add99f12
|
@ -38,13 +38,18 @@ describe('User', function(){
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Email is required', function(done) {
|
it('Email is required', function (done) {
|
||||||
User.create({password: '123'}, function (err) {
|
User.create({password: '123'}, function (err) {
|
||||||
assert.deepEqual(err, { name: 'ValidationError',
|
assert.deepEqual(err, {name: "ValidationError",
|
||||||
message: 'Validation error',
|
message: "The Model instance is not valid. See `details` "
|
||||||
statusCode: 400,
|
+ "property of the error object for more info.",
|
||||||
codes: { email: [ 'presence', 'format.blank', 'uniqueness' ] },
|
statusCode: 422,
|
||||||
context: 'user' });
|
details: {
|
||||||
|
context: "user",
|
||||||
|
codes: {email: ["presence", "format.blank", "uniqueness"]},
|
||||||
|
messages: {email: ["can't be blank", "is blank",
|
||||||
|
"Email already exists"]}}}
|
||||||
|
);
|
||||||
|
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue