Skip to content

Commit

Permalink
update model tests
Browse files Browse the repository at this point in the history
  • Loading branch information
segunolalive committed Jan 3, 2018
1 parent 934de74 commit c01b719
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 32 deletions.
11 changes: 0 additions & 11 deletions server/test/models/book.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,6 @@ describe('Book Model', () => {
});
});

it('should raise validation error if title field is missing',
(done) => {
Book.create({ ...modelMock.newBook, title: null })
.catch((error) => {
expect(error.errors[0].message).to.equal('title cannot be null');
expect(error.errors[0].type).to.equal('notNull Violation');
expect(error.errors[0].path).to.equal('title');
done();
});
});

it('should raise validation error if title already exists',
(done) => {
Book.create({ ...modelMock.newBook, username: 'somethingMadeUp' })
Expand Down
21 changes: 0 additions & 21 deletions server/test/models/user.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,6 @@ describe('User Model', () => {
});
});

it('should raise validation error if username field is missing',
(done) => {
User.create({ ...modelMock.newUser, username: null })
.catch((error) => {
expect(error.errors[0].message).to.equal('username cannot be null');
expect(error.errors[0].type).to.equal('notNull Violation');
done();
});
});

it('should raise validation error if email field is missing',
(done) => {
User.create({ ...modelMock.newUser, email: null })
.catch((error) => {
expect(error.errors[0].message).to.equal('email cannot be null');
expect(error.errors[0].type).to.equal('notNull Violation');
expect(error.errors[0].path).to.equal('email');
done();
});
});

it('should raise validation error if email already exists',
(done) => {
User.create({ ...modelMock.newUser, username: 'somethingMadeUp' })
Expand Down

0 comments on commit c01b719

Please sign in to comment.