Fixed redirects test suites

refs https://github.com/TryGhost/Toolbox/issues/138

- These tests still rely on the frontend to be present. Needs further investigation to remove "frontend: true" flag - it slows down test runs!
This commit is contained in:
Naz 2021-11-24 18:03:45 +04:00 committed by naz
parent ac3b2e5aee
commit 4811da45f2
3 changed files with 30 additions and 6 deletions

View File

@ -31,6 +31,7 @@ describe('Redirects API', function () {
fs.writeFileSync(path.join(contentFolder, 'data', 'redirects.json'), JSON.stringify([]));
return startGhost({
frontend: true,
redirectsFile: false,
contentFolder: contentFolder,
forceStart: true
@ -71,7 +72,10 @@ describe('Redirects API', function () {
});
it('override', function () {
return startGhost({forceStart: true})
return startGhost({
frontend: true,
forceStart: true
})
.then(() => {
return request
.get('/my-old-blog-post/')
@ -149,7 +153,11 @@ describe('Redirects API', function () {
it('override', function () {
// We want to test if we can override old redirects.json with new redirects.yaml
// That's why we start with .json.
return startGhost({forceStart: true, redirectsFileExt: '.json'})
return startGhost({
frontend: true,
forceStart: true,
redirectsFileExt: '.json'
})
.then(() => {
return request
.get('/my-old-blog-post/')

View File

@ -31,6 +31,7 @@ describe('Redirects API', function () {
fs.writeFileSync(path.join(contentFolder, 'data', 'redirects.json'), JSON.stringify([]));
return startGhost({
frontend: true,
redirectsFile: false,
contentFolder: contentFolder,
forceStart: true
@ -71,7 +72,10 @@ describe('Redirects API', function () {
});
it('override', function () {
return startGhost({forceStart: true})
return startGhost({
frontend: true,
forceStart: true
})
.then(() => {
return request
.get('/my-old-blog-post/')

View File

@ -31,6 +31,7 @@ describe('Redirects API', function () {
fs.writeFileSync(path.join(contentFolder, 'data', 'redirects.json'), JSON.stringify([]));
return startGhost({
frontend: true,
redirectsFile: false,
contentFolder: contentFolder,
forceStart: true
@ -71,7 +72,10 @@ describe('Redirects API', function () {
});
it('override', function () {
return startGhost({forceStart: true})
return startGhost({
frontend: true,
forceStart: true
})
.then(() => {
return request
.get('/my-old-blog-post/')
@ -147,7 +151,11 @@ describe('Redirects API', function () {
describe('Upload yaml', function () {
describe('Ensure re-registering redirects works', function () {
it('no redirects file exists', function () {
return startGhost({redirectsFile: false, forceStart: true})
return startGhost({
frontend: true,
redirectsFile: false,
forceStart: true
})
.then(() => {
return request
.get('/my-old-blog-post/')
@ -183,7 +191,11 @@ describe('Redirects API', function () {
it('override', function () {
// We want to test if we can override old redirects.json with new redirects.yaml
// That's why we start with .json.
return startGhost({forceStart: true, redirectsFileExt: '.json'})
return startGhost({
frontend: true,
forceStart: true,
redirectsFileExt: '.json'
})
.then(() => {
return request
.get('/my-old-blog-post/')