🐛 Fixed error message when get helper doesn't have API access (#10892)

closes #10875
This commit is contained in:
Vikas Potluri 2019-07-15 01:18:58 -05:00 committed by Fabien O'Carroll
parent e497486e78
commit b431dc56cb
2 changed files with 3 additions and 8 deletions

View File

@ -40,14 +40,10 @@ labs.enabledHelper = function enabledHelper(options, callback) {
common.logging.error(new common.errors.DisabledFeatureError(errDetails));
errString = new SafeString(
'<script>console.error("' + _.values(errDetails).join(' ') + '");</script>'
);
errString = new SafeString(`<script>console.error("${_.values(errDetails).join(' ')}");</script>`);
if (options.async) {
return Promise.resolve(function asyncError() {
return errString;
});
return Promise.resolve(errString);
}
return errString;

View File

@ -42,8 +42,7 @@ describe('{{#get}} helper', function () {
inverse.called.should.be.false();
should.exist(result);
result.should.be.a.Function();
result().should.be.an.Object().with.property(
result.should.be.an.Object().with.property(
'string',
'<script>console.error("The {{#get}} helper requires your theme to have API access. ' +
'Please enable the v2 API via your theme\'s package.json file. ' +