mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-17 23:44:39 -05:00
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:
parent
ac3b2e5aee
commit
4811da45f2
3 changed files with 30 additions and 6 deletions
|
@ -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/')
|
||||
|
|
|
@ -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/')
|
||||
|
|
|
@ -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/')
|
||||
|
|
Loading…
Add table
Reference in a new issue