Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test spec edits #1

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions test/user.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('User model', function () {

describe('fields:', function () {

it('include `first`, `last`, `age`, `email`, and `bio`', function () {
it('include `first`, `last`, `age`, `email`, and `bio`', function () {
return user.save()
.then(function (savedUser) {
expect(savedUser.first).to.equal('DB');
Expand All @@ -41,12 +41,12 @@ describe('User model', function () {
user.email = null;

return user.validate()
.then(function () {
.then( function ( ) {
throw new Error('validation should fail without email');
}, function (err) {
expect(err).to.be.an.instanceOf(Error);
expect(err.message).to.contain('email cannot be null');
});
}, function ( err ) {
expect( err ).to.be.an.instanceOf( Error );
expect(err.errors[0].type).to.contain('notNull Violation');
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alternatively:
expect(err.message).to.contain('Validation Error');
seems to work too

});
});

it('age must be at least 18', function () {
Expand Down