mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
7f1d3ebc07
- move all test files from core/test to test/ - updated all imports and other references - all code inside of core/ is then application code - tests are correctly at the root level - consistent with other repos/projects Co-authored-by: Kevin Ansfield <kevin@lookingsideways.co.uk>
36 lines
1.1 KiB
JavaScript
36 lines
1.1 KiB
JavaScript
var should = require('should'),
|
|
sinon = require('sinon'),
|
|
|
|
themeConfig = require('../../../../core/frontend/services/themes/config');
|
|
|
|
describe('Themes', function () {
|
|
afterEach(function () {
|
|
sinon.restore();
|
|
});
|
|
|
|
describe('Config', function () {
|
|
it('handles no package.json', function () {
|
|
var config = themeConfig.create();
|
|
|
|
config.should.eql({posts_per_page: 5});
|
|
});
|
|
|
|
it('handles package.json without config', function () {
|
|
var config = themeConfig.create({name: 'casper'});
|
|
|
|
config.should.eql({posts_per_page: 5});
|
|
});
|
|
|
|
it('handles allows package.json to overrideg default', function () {
|
|
var config = themeConfig.create({name: 'casper', config: {posts_per_page: 3}});
|
|
|
|
config.should.eql({posts_per_page: 3});
|
|
});
|
|
|
|
it('handles ignores non-allowed config', function () {
|
|
var config = themeConfig.create({name: 'casper', config: {magic: 'roundabout'}});
|
|
|
|
config.should.eql({posts_per_page: 5});
|
|
});
|
|
});
|
|
});
|