mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
Filestorage helper returns string true if config is object
no issue - else admin client gets [object Object] which is weird Please enter the commit message for your changes. Lines starting
This commit is contained in:
parent
676c4ab824
commit
c500b41536
2 changed files with 16 additions and 1 deletions
|
@ -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';
|
||||
};
|
||||
|
|
|
@ -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 () {
|
||||
|
|
Loading…
Add table
Reference in a new issue