mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-17 23:44:39 -05:00
Merge pull request #5818 from acburdine/infinity-fix
Fix config service bug causing client secrets to be rendered as infinite numbers
This commit is contained in:
commit
ed7bfe8f4a
2 changed files with 35 additions and 1 deletions
|
@ -1,7 +1,7 @@
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
function isNumeric(num) {
|
function isNumeric(num) {
|
||||||
return !isNaN(num);
|
return Ember.$.isNumeric(num);
|
||||||
}
|
}
|
||||||
|
|
||||||
function _mapType(val) {
|
function _mapType(val) {
|
||||||
|
|
34
core/client/tests/unit/services/config-test.js
Normal file
34
core/client/tests/unit/services/config-test.js
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
/* jshint expr:true */
|
||||||
|
import { expect } from 'chai';
|
||||||
|
import {
|
||||||
|
describeModule,
|
||||||
|
it
|
||||||
|
} from 'ember-mocha';
|
||||||
|
|
||||||
|
import Ember from 'ember';
|
||||||
|
|
||||||
|
describeModule(
|
||||||
|
'service:config',
|
||||||
|
'ConfigService',
|
||||||
|
{
|
||||||
|
// Specify the other units that are required for this test.
|
||||||
|
// needs: ['service:foo']
|
||||||
|
},
|
||||||
|
function () {
|
||||||
|
// Replace this with your real tests.
|
||||||
|
it('exists', function () {
|
||||||
|
var service = this.subject();
|
||||||
|
expect(service).to.be.ok;
|
||||||
|
});
|
||||||
|
|
||||||
|
it('correctly parses a client secret', function () {
|
||||||
|
Ember.$('<meta>').attr('name', 'env-clientSecret')
|
||||||
|
.attr('content', '23e435234423')
|
||||||
|
.appendTo('head');
|
||||||
|
|
||||||
|
var service = this.subject();
|
||||||
|
|
||||||
|
expect(service.get('clientSecret')).to.equal('23e435234423');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
Loading…
Add table
Reference in a new issue