mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 19:33:02 +03:00
Fixed flaky test
- the test wants to assert that the output contains 0-9 a-z characters, but it actually asserts the output is a number followed by alphabet characters - this commit updates the regex to allow any combination of letters and numbers
This commit is contained in:
parent
2acdde2535
commit
1f9d9b1185
@ -5,30 +5,30 @@ describe('Lib: Security - Secret', function () {
|
||||
it('generates a 13 byte secret if asked for a content secret', function () {
|
||||
let secret = security.secret.create('content');
|
||||
secret.should.be.a.String().with.lengthOf(13 * 2);
|
||||
secret.should.match(/[0-9][a-z]+/);
|
||||
secret.should.match(/[0-9a-z]+/);
|
||||
});
|
||||
|
||||
it('generates a specific length secret if given a length', function () {
|
||||
let secret = security.secret.create(10);
|
||||
secret.should.be.a.String().with.lengthOf(10);
|
||||
secret.should.match(/[0-9][a-z]+/);
|
||||
secret.should.match(/[0-9a-z]+/);
|
||||
});
|
||||
|
||||
it('generates a specific length secret if given a length even when odd', function () {
|
||||
let secret = security.secret.create(15);
|
||||
secret.should.be.a.String().with.lengthOf(15);
|
||||
secret.should.match(/[0-9][a-z]+/);
|
||||
secret.should.match(/[0-9a-z]+/);
|
||||
});
|
||||
|
||||
it('generates a 32 byte secret if asked for an admin secret', function () {
|
||||
let secret = security.secret.create('admin');
|
||||
secret.should.be.a.String().with.lengthOf(32 * 2);
|
||||
secret.should.match(/[0-9][a-z]+/);
|
||||
secret.should.match(/[0-9a-z]+/);
|
||||
});
|
||||
|
||||
it('generates a 32 byte secret by default', function () {
|
||||
let secret = security.secret.create();
|
||||
secret.should.be.a.String().with.lengthOf(32 * 2);
|
||||
secret.should.match(/[0-9][a-z]+/);
|
||||
secret.should.match(/[0-9a-z]+/);
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user