| 79 | |
| 80 | test( 'username in password should be penalized', function() { |
| 81 | var allowedPasswordScore, penalizedPasswordScore, |
| 82 | allowedPassword = 'a[janedoe]4', |
| 83 | penalizedPassword = 'a[johndoe]4', |
| 84 | username = 'johndoe'; |
| 85 | |
| 86 | allowedPasswordScore = passwordStrength( allowedPassword, username, allowedPassword ); |
| 87 | penalizedPasswordScore = passwordStrength( penalizedPassword, username, penalizedPassword ); |
| 88 | |
| 89 | ok( penalizedPasswordScore < allowedPasswordScore, 'Penalized password scored ' + penalizedPasswordScore + '; allowed password scored: ' + allowedPasswordScore ); |
| 90 | } ); |