0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-04 02:01:58 -05:00

Dynamic Routing Beta: Render default.hbs as fallback for static routes

refs refs #9601

- instead of index.hbs (that doesn't make sense)
This commit is contained in:
kirrg001 2018-06-24 00:32:09 +02:00 committed by Katharina Irrgang
parent c2fa469c4d
commit 07c72d735e
3 changed files with 7 additions and 7 deletions

View file

@ -81,7 +81,8 @@ class StaticRoutesRouter extends ParentRouter {
res._route = {
type: 'custom',
templates: this.templates
templates: this.templates,
defaultTemplate: 'default'
};
next();

View file

@ -475,7 +475,7 @@ describe('Integration - Web - Site', function () {
sandbox.restore();
});
it('serve home', function () {
it('serve static route', function () {
const req = {
secure: true,
method: 'GET',
@ -486,9 +486,7 @@ describe('Integration - Web - Site', function () {
return testUtils.mocks.express.invoke(app, req)
.then(function (response) {
response.statusCode.should.eql(200);
// falls back to index, because Casper has no home.hbs
response.template.should.eql('index');
response.template.should.eql('default');
});
});
@ -604,7 +602,7 @@ describe('Integration - Web - Site', function () {
return testUtils.mocks.express.invoke(app, req)
.then(function (response) {
response.statusCode.should.eql(200);
response.template.should.eql('index');
response.template.should.eql('default');
});
});
});

View file

@ -83,7 +83,8 @@ describe('UNIT - services/routing/StaticRoutesRouter', function () {
next.called.should.be.true();
res._route.should.eql({
type: 'custom',
templates: []
templates: [],
defaultTemplate: 'default'
});
res.locals.routerOptions.should.eql({context: [], data: {}});