From a38abd0f8cdbc4f62d95ae29df38b3276e93484d Mon Sep 17 00:00:00 2001 From: jloveland Date: Thu, 10 Sep 2015 23:06:36 -0400 Subject: [PATCH] fixing jshint issues by requiring single quotes --- .../password-validator.client.directive.js | 10 +++++----- .../password-verify.client.directive.js | 8 ++++---- .../password-validator.client.service.js | 2 +- .../tests/server/user.server.model.tests.js | 18 +++++++++--------- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/modules/users/client/directives/password-validator.client.directive.js b/modules/users/client/directives/password-validator.client.directive.js index da9fe08370..9530fcd573 100644 --- a/modules/users/client/directives/password-validator.client.directive.js +++ b/modules/users/client/directives/password-validator.client.directive.js @@ -11,11 +11,11 @@ angular.module('users') // Strength Meter - visual indicator for users var strengthMeter = [ - { color: "danger", progress: "20" }, - { color: "warning", progress: "40"}, - { color: "info", progress: "60"}, - { color: "primary", progress: "80"}, - { color: "success", progress: "100"} + { color: 'danger', progress: '20' }, + { color: 'warning', progress: '40'}, + { color: 'info', progress: '60'}, + { color: 'primary', progress: '80'}, + { color: 'success', progress: '100'} ]; var strengthMax = strengthMeter.length; diff --git a/modules/users/client/directives/password-verify.client.directive.js b/modules/users/client/directives/password-verify.client.directive.js index 63e6c13a84..e31565dbde 100644 --- a/modules/users/client/directives/password-verify.client.directive.js +++ b/modules/users/client/directives/password-verify.client.directive.js @@ -1,9 +1,9 @@ 'use strict'; angular.module('users') - .directive("passwordVerify", function() { + .directive('passwordVerify', function() { return { - require: "ngModel", + require: 'ngModel', scope: { passwordVerify: '=' }, @@ -19,10 +19,10 @@ angular.module('users') modelCtrl.$parsers.unshift(function(viewValue) { var origin = scope.passwordVerify; if (origin !== viewValue) { - modelCtrl.$setValidity("passwordVerify", false); + modelCtrl.$setValidity('passwordVerify', false); return undefined; } else { - modelCtrl.$setValidity("passwordVerify", true); + modelCtrl.$setValidity('passwordVerify', true); return viewValue; } }); diff --git a/modules/users/client/services/password-validator.client.service.js b/modules/users/client/services/password-validator.client.service.js index 0c10f554e2..6fcc28d74b 100644 --- a/modules/users/client/services/password-validator.client.service.js +++ b/modules/users/client/services/password-validator.client.service.js @@ -11,7 +11,7 @@ angular.module('users').factory('PasswordValidator', ['$window', return result; }, getPopoverMsg: function () { - var popoverMsg = "Please enter a passphrase or password with greater than 10 characters, numbers, lowercase, upppercase, and special characters."; + var popoverMsg = 'Please enter a passphrase or password with greater than 10 characters, numbers, lowercase, upppercase, and special characters.'; return popoverMsg; } }; diff --git a/modules/users/tests/server/user.server.model.tests.js b/modules/users/tests/server/user.server.model.tests.js index ad8e6f401b..128a7b3754 100644 --- a/modules/users/tests/server/user.server.model.tests.js +++ b/modules/users/tests/server/user.server.model.tests.js @@ -218,7 +218,7 @@ describe('User Model Unit Tests:', function () { }); }); - describe("User Password Validation Tests", function() { + describe('User Password Validation Tests', function() { it('should validate when the password strength passes - "P@$$w0rd!!"', function () { var _user1 = new User(user1); _user1.password = 'P@$$w0rd!!'; @@ -251,7 +251,7 @@ describe('User Model Unit Tests:', function () { _user1.password = 'P@$$w0rd!'; _user1.validate(function (err) { - err.errors.password.message.should.equal("The password must be at least 10 characters long."); + err.errors.password.message.should.equal('The password must be at least 10 characters long.'); done(); }); }); @@ -261,7 +261,7 @@ describe('User Model Unit Tests:', function () { _user1.password = ')!/uLT="lh&:`6X!]|15o!$!TJf,.13l?vG].-j],lFPe/QhwN#{Z<[*1nX@n1^?WW-%_.*D)m$toB+N7z}kcN#B_d(f41h%w@0F!]igtSQ1gl~6sEV&r~}~1ub>If1c+'; _user1.validate(function (err) { - err.errors.password.message.should.equal("The password must be fewer than 128 characters."); + err.errors.password.message.should.equal('The password must be fewer than 128 characters.'); done(); }); }); @@ -271,7 +271,7 @@ describe('User Model Unit Tests:', function () { _user1.password = 'P@$$w0rd!!!'; _user1.validate(function (err) { - err.errors.password.message.should.equal("The password may not contain sequences of three or more repeated characters."); + err.errors.password.message.should.equal('The password may not contain sequences of three or more repeated characters.'); done(); }); }); @@ -281,7 +281,7 @@ describe('User Model Unit Tests:', function () { _user1.password = 'p@$$w0rd!!'; _user1.validate(function (err) { - err.errors.password.message.should.equal("The password must contain at least one uppercase letter."); + err.errors.password.message.should.equal('The password must contain at least one uppercase letter.'); done(); }); }); @@ -291,7 +291,7 @@ describe('User Model Unit Tests:', function () { _user1.password = 'P@$$word!!'; _user1.validate(function (err) { - err.errors.password.message.should.equal("The password must contain at least one number."); + err.errors.password.message.should.equal('The password must contain at least one number.'); done(); }); }); @@ -301,13 +301,13 @@ describe('User Model Unit Tests:', function () { _user1.password = 'Passw0rdss'; _user1.validate(function (err) { - err.errors.password.message.should.equal("The password must contain at least one special character."); + err.errors.password.message.should.equal('The password must contain at least one special character.'); done(); }); }); }); - describe("User E-mail Validation Tests", function() { + describe('User E-mail Validation Tests', function() { it('should not allow invalid email address - "123"', function (done) { var _user1 = new User(user1); @@ -476,7 +476,7 @@ describe('User Model Unit Tests:', function () { it('should allow single quote characters in email address - "abc\'def@abc.com"', function (done) { var _user1 = new User(user1); - _user1.email = "abc\'def@abc.com"; + _user1.email = 'abc\'def@abc.com'; _user1.save(function (err) { if (!err) { _user1.remove(function (err_remove) {