From 14b8dd4dce27776a61673523a2af39c1d4f81b45 Mon Sep 17 00:00:00 2001 From: mleanos Date: Sun, 30 Aug 2015 15:53:29 -0700 Subject: [PATCH] Fixed User model tests 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` --- .../tests/server/user.server.model.tests.js | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/modules/users/tests/server/user.server.model.tests.js b/modules/users/tests/server/user.server.model.tests.js index 9ce39106d7..e40e56d0be 100644 --- a/modules/users/tests/server/user.server.model.tests.js +++ b/modules/users/tests/server/user.server.model.tests.js @@ -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(); }); @@ -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(); }); @@ -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(); });