0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-04-15 03:01:37 -05:00

Merge pull request #3743 from ErisDS/filestorage-helper

Filestorage helper returns string true if config is object
This commit is contained in:
Sebastian Gierlinger 2014-08-11 13:12:58 +02:00
commit ffe2ad2d9f
2 changed files with 16 additions and 1 deletions

View file

@ -355,7 +355,7 @@ coreHelpers.excerpt = function (options) {
coreHelpers.file_storage = function (context, options) {
/*jshint unused:false*/
if (config.hasOwnProperty('fileStorage')) {
return config.fileStorage.toString();
return _.isObject(config.fileStorage) ? 'true' : config.fileStorage.toString();
}
return 'true';
};

View file

@ -1754,6 +1754,21 @@ describe('Core Helpers', function () {
should.exist(fileStorage);
fileStorage.should.equal(setting);
});
it('should just return true if config.fileStorage is an object', function () {
var setting = {someKey: 'someValue'},
cfg = helpers.__get__('config'),
fileStorage;
_.extend(cfg, {
fileStorage: setting
});
fileStorage = helpers.file_storage();
should.exist(fileStorage);
fileStorage.should.equal('true');
});
});
describe('apps helper', function () {