mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-02 08:13:34 +03:00
6c5fea40ca
closes #5298 - remove all harcoded instances of jQuery throughout the front-end of the blog - add migration function to add cdn link to ghost_foot code injection when migrating up from version 003 - migration version bump
41 lines
1.6 KiB
JavaScript
41 lines
1.6 KiB
JavaScript
/*globals describe, before, beforeEach, afterEach, it */
|
|
/*jshint expr:true*/
|
|
var testUtils = require('../utils'),
|
|
should = require('should'),
|
|
|
|
migration = require('../../server/data/migration/index'),
|
|
Models = require('../../server/models');
|
|
|
|
describe('Database Migration (special functions)', function () {
|
|
before(testUtils.teardown);
|
|
afterEach(testUtils.teardown);
|
|
|
|
describe('004', function () {
|
|
beforeEach(testUtils.setup('settings'));
|
|
|
|
it('should add jQuery to ghost_foot injection setting', function (done) {
|
|
Models.Settings.findOne('ghost_foot').then(function (setting) {
|
|
should.exist(setting);
|
|
should.exist(setting.attributes);
|
|
setting.attributes.value.should.equal('');
|
|
|
|
process.env.FORCE_MIGRATION = true; // force a migration
|
|
migration.init().then(function () {
|
|
Models.Settings.findOne('ghost_foot').then(function (result) {
|
|
var jquery = [
|
|
'<!-- You can safely delete this line if your theme does not require jQuery -->\n',
|
|
'<script type="text/javascript" src="https://code.jquery.com/jquery-1.11.3.min.js"></script>\n\n'
|
|
];
|
|
|
|
should.exist(result);
|
|
should.exist(result.attributes);
|
|
result.attributes.value.should.equal(jquery.join(''));
|
|
|
|
done();
|
|
});
|
|
});
|
|
});
|
|
});
|
|
});
|
|
});
|