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

Commit

Permalink
Fixed User model tests
Browse files Browse the repository at this point in the history
PR #840 changed the global var `user` to `user1`. This was merged and
then #858 was merged, which was still referencing the global var as
`user` in the new *roles* tests. This was causing jshint failures from
the new

This change updates the new *roles* tests to use `user1`
  • Loading branch information
mleanos committed Aug 30, 2015
1 parent 8335aa7 commit 14b8dd4
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions modules/users/tests/server/user.server.model.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,14 @@ describe('User Model Unit Tests:', function () {
});

it('should be able to update an existing user with valid roles without problems', function (done) {
var _user = new User(user);
var _user1 = new User(user1);

_user.save(function (err) {
_user1.save(function (err) {
should.not.exist(err);
_user.roles = ['user', 'admin'];
_user.save(function (err) {
_user1.roles = ['user', 'admin'];
_user1.save(function (err) {
should.not.exist(err);
_user.remove(function (err) {
_user1.remove(function (err) {
should.not.exist(err);
done();
});
Expand All @@ -102,14 +102,14 @@ describe('User Model Unit Tests:', function () {
});

it('should be able to show an error when trying to update an existing user without a role', function (done) {
var _user = new User(user);
var _user1 = new User(user1);

_user.save(function (err) {
_user1.save(function (err) {
should.not.exist(err);
_user.roles = [];
_user.save(function (err) {
_user1.roles = [];
_user1.save(function (err) {
should.exist(err);
_user.remove(function (err) {
_user1.remove(function (err) {
should.not.exist(err);
done();
});
Expand All @@ -118,14 +118,14 @@ describe('User Model Unit Tests:', function () {
});

it('should be able to show an error when trying to update an existing user with a invalid role', function (done) {
var _user = new User(user);
var _user1 = new User(user1);

_user.save(function (err) {
_user1.save(function (err) {
should.not.exist(err);
_user.roles = ['invalid-user-role-enum'];
_user.save(function (err) {
_user1.roles = ['invalid-user-role-enum'];
_user1.save(function (err) {
should.exist(err);
_user.remove(function (err) {
_user1.remove(function (err) {
should.not.exist(err);
done();
});
Expand Down

0 comments on commit 14b8dd4

Please sign in to comment.