🎨 missing get/set config changes

refs #6982
[ci skip]
This commit is contained in:
kirrg001 2016-09-13 21:45:05 +02:00 committed by Hannah Wolfe
parent 248ceba72b
commit 3e02dbf734
2 changed files with 13 additions and 13 deletions

View File

@ -133,21 +133,21 @@ describe('Config', function () {
});
config.should.have.property('config', configFile);
config.paths.should.have.property('contentPath', contentPath);
config.paths.should.have.property('themePath', contentPath + 'themes');
config.paths.should.have.property('appPath', contentPath + 'apps');
config.paths.should.have.property('imagesPath', contentPath + 'images');
config.get('paths').should.have.property('contentPath', contentPath);
config.get('paths').should.have.property('themePath', contentPath + 'themes');
config.get('paths').should.have.property('appPath', contentPath + 'apps');
config.get('paths').should.have.property('imagesPath', contentPath + 'images');
});
});
describe('Storage', function () {
it('should default to local-file-store', function () {
config.paths.should.have.property('storagePath', {
config.get('paths').should.have.property('storagePath', {
default: path.join(config.get('paths').corePath, '/server/storage/'),
custom: path.join(config.get('paths').contentPath, 'storage/')
});
config.storage.should.have.property('active', {
config.get('storage').should.have.property('active', {
images: 'local-file-store',
themes: 'local-file-store'
});
@ -163,12 +163,12 @@ describe('Config', function () {
}
});
config.storage.should.have.property('active', {
config.get('storage').should.have.property('active', {
images: 's3',
themes: 'local-file-store'
});
config.storage.should.have.property('s3', {});
config.get('storage').should.have.property('s3', {});
});
it('should use default theme adapter when passing an object', function () {

View File

@ -12,8 +12,8 @@ describe('storage: index_spec', function () {
var scope = {adapter: null};
before(function () {
if (!fs.existsSync(configUtils.config.paths.storagePath.custom)) {
fs.mkdirSync(configUtils.config.paths.storagePath.custom);
if (!fs.existsSync(configUtils.config.get('paths').storagePath.custom)) {
fs.mkdirSync(configUtils.config.get('paths').storagePath.custom);
}
});
@ -48,7 +48,7 @@ describe('storage: index_spec', function () {
describe('custom ghost storage config', function () {
it('images storage adapter is custom, themes is default', function () {
scope.adapter = configUtils.config.paths.storagePath.custom + 'custom-adapter.js';
scope.adapter = configUtils.config.get('paths').storagePath.custom + 'custom-adapter.js';
configUtils.set({
storage: {
@ -81,7 +81,7 @@ describe('storage: index_spec', function () {
describe('adapter validation', function () {
it('create good adapter', function () {
scope.adapter = configUtils.config.paths.storagePath.custom + 'another-storage.js';
scope.adapter = configUtils.config.get('paths').storagePath.custom + 'another-storage.js';
configUtils.set({
storage: {
@ -111,7 +111,7 @@ describe('storage: index_spec', function () {
});
it('create bad adapter: exists fn is missing', function () {
scope.adapter = configUtils.config.paths.storagePath.custom + 'broken-storage.js';
scope.adapter = configUtils.config.get('paths').storagePath.custom + 'broken-storage.js';
configUtils.set({
storage: {