Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
Merge pull request #768 from lirantal/feature/users_module_tests_2
Browse files Browse the repository at this point in the history
Updating User model tests for synchronous test and fixing done() calls
  • Loading branch information
lirantal committed Aug 6, 2015
2 parents fe20d3c + c967a98 commit 0f3259f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions modules/users/tests/server/user.server.model.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var user, user2, user3;
* Unit tests
*/
describe('User Model Unit Tests:', function () {
before(function (done) {
before(function () {
user = {
firstName: 'Full',
lastName: 'Name',
Expand Down Expand Up @@ -45,7 +45,6 @@ describe('User Model Unit Tests:', function () {
provider: 'local'
};

done();
});

describe('Method Save', function () {
Expand All @@ -71,7 +70,7 @@ describe('User Model Unit Tests:', function () {
it('should fail to save an existing user again', function (done) {
var _user = new User(user);
var _user2 = new User(user2);

_user.save(function () {
_user2.save(function (err) {
should.exist(err);
Expand Down Expand Up @@ -130,7 +129,7 @@ describe('User Model Unit Tests:', function () {
});
});

it('should not be able to save different user with the same email address', function (done) {
it('should not be able to save different user with the same email address', function () {
var _user = new User(user);
var _user3 = new User(user3);

Expand All @@ -143,7 +142,6 @@ describe('User Model Unit Tests:', function () {
should.exist(err);
// Restoring the original email for test3 so it can be used in later tests
_user3.email = user3_email;
done();
});
});
});
Expand Down

0 comments on commit 0f3259f

Please sign in to comment.