0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

Fixed AMP test for 'static pages'

no issue

- 'static pages' (post of a page type) were not supported in v0.1 API
- this is where the 404 is comming from  - df7e64fafa/core/frontend/apps/amp/lib/router.js (L66). and it was handled in rather late stage before - df7e64fafa/core/frontend/apps/amp/lib/router.js (L24)
- after moveing to v2 API the later stage doesn't happen so the entry lookup helper doesn't have anough infomration to tell if it's a 'Post' or 'Page' is being requested
This commit is contained in:
Nazar Gargol 2019-09-11 15:48:23 +02:00
parent c411795741
commit 4876f5fc13

View file

@ -359,10 +359,12 @@ describe('Frontend Routing', function () {
describe('amp', function () {
it('should 404 for amp parameter', function (done) {
// NOTE: only post pages are supported so the router doesn't have a way to distinguish if
// the request was done after AMP 'Page' or 'Post'
request.get('/static-page-test/amp/')
.expect('Cache-Control', testUtils.cacheRules.private)
.expect(404)
.expect(/Page not found/)
.expect(/Post not found/)
.end(doEnd(done));
});
});