From 4876f5fc138bbf29d651414376b4cb4a65a04f39 Mon Sep 17 00:00:00 2001 From: Nazar Gargol Date: Wed, 11 Sep 2019 15:48:23 +0200 Subject: [PATCH] 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 - https://github.com/TryGhost/Ghost/blob/df7e64fafa122ec5d461c4772eca86d21938046b/core/frontend/apps/amp/lib/router.js#L66. and it was handled in rather late stage before - https://github.com/TryGhost/Ghost/blob/df7e64fafa122ec5d461c4772eca86d21938046b/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 --- core/test/regression/site/frontend_spec.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/test/regression/site/frontend_spec.js b/core/test/regression/site/frontend_spec.js index 58b1d84b6f..8d0135324e 100644 --- a/core/test/regression/site/frontend_spec.js +++ b/core/test/regression/site/frontend_spec.js @@ -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)); }); });