From 89d40133a0b80b45f2a9ac17fa3dd48addde2c23 Mon Sep 17 00:00:00 2001 From: Aileen Nowak Date: Mon, 30 Jan 2017 15:54:40 +0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20=20Clean=20up=20ghost=5Fhead=20t?= =?UTF-8?q?est=20(#7918)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit refs #7688 Update the `ghost_head_spec` to reflect the current changes (we're not having a default `icon` setting in our config anymore). Render the link to the default favicon to be relative. --- core/server/helpers/ghost_head.js | 2 +- .../unit/server_helpers/ghost_head_spec.js | 49 +++++++++---------- 2 files changed, 25 insertions(+), 26 deletions(-) diff --git a/core/server/helpers/ghost_head.js b/core/server/helpers/ghost_head.js index 38cea3242f..3fc505045d 100644 --- a/core/server/helpers/ghost_head.js +++ b/core/server/helpers/ghost_head.js @@ -90,7 +90,7 @@ function ghost_head(options) { }, // CASE: blog icon is not set in config, we serve the default iconType = !config.get('theme:icon') ? 'x-icon' : config.get('theme:icon').match(/\/favicon\.ico$/i) ? 'x-icon' : 'png', - favicon = !config.get('theme:icon') ? '/favicon.ico' : utils.url.urlFor('image', {image: config.get('theme:icon')}, true); + favicon = !config.get('theme:icon') ? '/favicon.ico' : utils.url.urlFor('image', {image: config.get('theme:icon')}); return Promise.props(fetch).then(function (response) { client = response.client; diff --git a/core/test/unit/server_helpers/ghost_head_spec.js b/core/test/unit/server_helpers/ghost_head_spec.js index 8700f59542..2e345d9521 100644 --- a/core/test/unit/server_helpers/ghost_head_spec.js +++ b/core/test/unit/server_helpers/ghost_head_spec.js @@ -53,8 +53,7 @@ describe('{{ghost_head}} helper', function () { title: 'Ghost', description: 'blog description', cover: '/content/images/blog-cover.png', - amp: true, - icon: 'core/shared/favicon.ico' + amp: true } }); }); @@ -69,7 +68,7 @@ describe('{{ghost_head}} helper', function () { {data: {root: {context: ['paged', 'index']}}} ).then(function (rendered) { should.exist(rendered); - rendered.string.should.match(//); + rendered.string.should.match(//); rendered.string.should.match(//); rendered.string.should.match(//); rendered.string.should.match(//); @@ -86,7 +85,7 @@ describe('{{ghost_head}} helper', function () { {data: {root: {context: ['home', 'index']}}} ).then(function (rendered) { should.exist(rendered); - rendered.string.should.match(//); + rendered.string.should.match(//); rendered.string.should.match(//); rendered.string.should.match(//); rendered.string.should.match(//); @@ -139,7 +138,7 @@ describe('{{ghost_head}} helper', function () { {data: {root: {context: ['page']}}} ).then(function (rendered) { should.exist(rendered); - rendered.string.should.match(//); + rendered.string.should.match(//); rendered.string.should.match(//); rendered.string.should.match(//); rendered.string.should.match(//); @@ -186,7 +185,7 @@ describe('{{ghost_head}} helper', function () { {data: {root: {context: ['tag']}}} ).then(function (rendered) { should.exist(rendered); - rendered.string.should.match(//); + rendered.string.should.match(//); rendered.string.should.match(//); rendered.string.should.match(//); rendered.string.should.match(//); @@ -228,7 +227,7 @@ describe('{{ghost_head}} helper', function () { {data: {root: {context: ['tag']}}} ).then(function (rendered) { should.exist(rendered); - rendered.string.should.match(//); + rendered.string.should.match(//); rendered.string.should.match(//); rendered.string.should.match(//); rendered.string.should.match(//); @@ -269,7 +268,7 @@ describe('{{ghost_head}} helper', function () { {data: {root: {context: ['tag']}}} ).then(function (rendered) { should.exist(rendered); - rendered.string.should.match(//); + rendered.string.should.match(//); rendered.string.should.not.match(//); rendered.string.should.not.match(//); rendered.string.should.not.match(/"description":/); @@ -291,7 +290,7 @@ describe('{{ghost_head}} helper', function () { {data: {root: {context: ['tag']}}} ).then(function (rendered) { should.exist(rendered); - rendered.string.should.match(//); + rendered.string.should.match(//); rendered.string.should.match(//); rendered.string.should.match(//); rendered.string.should.match(//); @@ -319,7 +318,7 @@ describe('{{ghost_head}} helper', function () { {data: {root: {context: ['author']}}} ).then(function (rendered) { should.exist(rendered); - rendered.string.should.match(//); + rendered.string.should.match(//); rendered.string.should.match(//); rendered.string.should.match(//); rendered.string.should.match(//); @@ -365,7 +364,7 @@ describe('{{ghost_head}} helper', function () { {data: {root: {context: ['paged', 'author']}}} ).then(function (rendered) { should.exist(rendered); - rendered.string.should.match(//); + rendered.string.should.match(//); rendered.string.should.match(//); rendered.string.should.match(//); rendered.string.should.match(//); @@ -382,7 +381,7 @@ describe('{{ghost_head}} helper', function () { {data: {root: {context: []}}} ).then(function (rendered) { should.exist(rendered); - rendered.string.should.match(//); + rendered.string.should.match(//); rendered.string.should.match(//); rendered.string.should.match(//); @@ -420,7 +419,7 @@ describe('{{ghost_head}} helper', function () { re4 = new RegExp('"dateModified": "' + post.updated_at); should.exist(rendered); - rendered.string.should.match(//); + rendered.string.should.match(//); rendered.string.should.match(//); rendered.string.should.match(//); rendered.string.should.match(//); @@ -499,7 +498,7 @@ describe('{{ghost_head}} helper', function () { re4 = new RegExp('"dateModified": "' + post.updated_at); should.exist(rendered); - rendered.string.should.match(//); + rendered.string.should.match(//); rendered.string.should.match(//); rendered.string.should.not.match(//); rendered.string.should.match(//); @@ -578,7 +577,7 @@ describe('{{ghost_head}} helper', function () { re4 = new RegExp('"dateModified": "' + post.updated_at); should.exist(rendered); - rendered.string.should.match(//); + rendered.string.should.match(//); rendered.string.should.match(//); rendered.string.should.match(//); rendered.string.should.match(//); @@ -655,7 +654,7 @@ describe('{{ghost_head}} helper', function () { re4 = new RegExp('"dateModified": "' + post.updated_at); should.exist(rendered); - rendered.string.should.match(//); + rendered.string.should.match(//); rendered.string.should.match(//); rendered.string.should.match(//); rendered.string.should.match(//); @@ -730,7 +729,7 @@ describe('{{ghost_head}} helper', function () { re4 = new RegExp('"dateModified": "' + post.updated_at); should.exist(rendered); - rendered.string.should.match(//); + rendered.string.should.match(//); rendered.string.should.match(//); rendered.string.should.match(//); rendered.string.should.match(//); @@ -782,7 +781,7 @@ describe('{{ghost_head}} helper', function () { {data: {root: {context: ['featured']}}} ).then(function (rendered) { should.exist(rendered); - rendered.string.should.match(//); + rendered.string.should.match(//); rendered.string.should.match(//); rendered.string.should.match(//); rendered.string.should.match(//); @@ -811,7 +810,7 @@ describe('{{ghost_head}} helper', function () { {data: {root: {context: ['post']}}} ).then(function (rendered) { should.exist(rendered); - rendered.string.should.match(//); + rendered.string.should.match(//); rendered.string.should.match(//); rendered.string.should.match(//); rendered.string.should.match(//); @@ -834,7 +833,7 @@ describe('{{ghost_head}} helper', function () { {data: {root: {context: ['page']}}} ).then(function (rendered) { should.exist(rendered); - rendered.string.should.match(//); + rendered.string.should.match(//); rendered.string.should.match(//); rendered.string.should.match(//); rendered.string.should.match(//); @@ -849,7 +848,7 @@ describe('{{ghost_head}} helper', function () { {data: {root: {context: ['index', 'paged'], pagination: {total: 4, page: 3, next: 4, prev: 2}}}} ).then(function (rendered) { should.exist(rendered); - rendered.string.should.match(//); + rendered.string.should.match(//); rendered.string.should.match(//); rendered.string.should.match(//); rendered.string.should.match(//); @@ -868,7 +867,7 @@ describe('{{ghost_head}} helper', function () { {data: {root: {context: ['index', 'paged'], pagination: {total: 3, page: 2, next: 3, prev: 1}}}} ).then(function (rendered) { should.exist(rendered); - rendered.string.should.match(//); + rendered.string.should.match(//); rendered.string.should.match(//); rendered.string.should.match(//); rendered.string.should.match(//); @@ -982,7 +981,7 @@ describe('{{ghost_head}} helper', function () { {data: {root: {context: ['post']}}} ).then(function (rendered) { should.exist(rendered); - rendered.string.should.match(//); + rendered.string.should.match(//); rendered.string.should.match(//); rendered.string.should.match(//); rendered.string.should.match(//); @@ -1018,7 +1017,7 @@ describe('{{ghost_head}} helper', function () { {data: {root: {context: []}}} ).then(function (rendered) { should.exist(rendered); - rendered.string.should.match(//); + rendered.string.should.match(//); rendered.string.should.match(//); rendered.string.should.match(//); rendered.string.should.match(//); @@ -1051,7 +1050,7 @@ describe('{{ghost_head}} helper', function () { {data: {root: {context: []}}} ).then(function (rendered) { should.exist(rendered); - rendered.string.should.match(//); + rendered.string.should.match(//); rendered.string.should.match(//); rendered.string.should.match(//); rendered.string.should.match(//);