mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 11:55:03 +03:00
Ghost footer outputs minified jquery in production
Closes #2524 - Added minifying jquery in grunt prod task - Add test coverage for altered jquery
This commit is contained in:
parent
395d7fd3e2
commit
758f844b8b
@ -565,7 +565,8 @@ var path = require('path'),
|
||||
uglify: {
|
||||
prod: {
|
||||
files: {
|
||||
'core/built/scripts/ghost.min.js': 'core/built/scripts/ghost.js'
|
||||
'core/built/scripts/ghost.min.js': 'core/built/scripts/ghost.js',
|
||||
'core/built/public/jquery.min.js': 'core/built/public/jquery.js'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -460,10 +460,11 @@ coreHelpers.ghost_head = function (options) {
|
||||
|
||||
coreHelpers.ghost_foot = function (options) {
|
||||
/*jshint unused:false*/
|
||||
var foot = [];
|
||||
var jquery = isProduction ? 'jquery.min.js' : 'jquery.js',
|
||||
foot = [];
|
||||
|
||||
foot.push(scriptTemplate({
|
||||
source: config().paths.subdir + '/public/jquery.js',
|
||||
source: config().paths.subdir + '/public/' + jquery,
|
||||
version: coreHelpers.assetHash
|
||||
}));
|
||||
|
||||
|
@ -452,8 +452,7 @@ describe('Core Helpers', function () {
|
||||
should.exist(handlebars.helpers.ghost_foot);
|
||||
});
|
||||
|
||||
it('returns meta tag string', function (done) {
|
||||
|
||||
it('outputs correct jquery for development mode', function (done) {
|
||||
helpers.assetHash = 'abc';
|
||||
|
||||
helpers.ghost_foot.call().then(function (rendered) {
|
||||
@ -463,6 +462,18 @@ describe('Core Helpers', function () {
|
||||
done();
|
||||
}).then(null, done);
|
||||
});
|
||||
|
||||
it('outputs correct jquery for production mode', function (done) {
|
||||
helpers.assetHash = 'abc';
|
||||
helpers.__set__('isProduction', true);
|
||||
|
||||
helpers.ghost_foot.call().then(function (rendered) {
|
||||
should.exist(rendered);
|
||||
rendered.string.should.match(/<script src=".*\/public\/jquery.min.js\?v=abc"><\/script>/);
|
||||
|
||||
done();
|
||||
}).then(null, done);
|
||||
});
|
||||
});
|
||||
|
||||
describe('has Block Helper', function () {
|
||||
|
Loading…
Reference in New Issue
Block a user