mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 05:50:35 +03:00
7f1d3ebc07
- move all test files from core/test to test/ - updated all imports and other references - all code inside of core/ is then application code - tests are correctly at the root level - consistent with other repos/projects Co-authored-by: Kevin Ansfield <kevin@lookingsideways.co.uk>
19 lines
614 B
JavaScript
19 lines
614 B
JavaScript
const should = require('should'),
|
|
security = require('../../../../core/server/lib/security');
|
|
|
|
describe('Lib: Security - Password', function () {
|
|
it('hash plain password', function () {
|
|
return security.password.hash('test')
|
|
.then(function (hash) {
|
|
hash.should.match(/^\$2[ayb]\$.{56}$/);
|
|
});
|
|
});
|
|
|
|
it('compare password', function () {
|
|
return security.password.compare('test', '$2a$10$we16f8rpbrFZ34xWj0/ZC.LTPUux8ler7bcdTs5qIleN6srRHhilG')
|
|
.then(function (valid) {
|
|
valid.should.be.true;
|
|
});
|
|
});
|
|
});
|