0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

Fixing bug with ghost-url overwriting url

refs #6223

- I made a stupid error, whereby apiUrl was always set to '' in themes
This commit is contained in:
Hannah Wolfe 2015-12-15 14:16:00 +00:00
parent 53cdb4398b
commit e5b0609b33
2 changed files with 10 additions and 1 deletions

View file

@ -54,7 +54,7 @@
init = function (options) {
clientId = options.clientId ? options.clientId : '';
clientSecret = options.clientSecret ? options.clientSecret : '';
apiUrl = options.url ? options.url : '';
apiUrl = options.url ? options.url : (apiUrl.match(/{\{api-url}}/) ? '' : apiUrl);
};
if (typeof window !== 'undefined') {

View file

@ -18,6 +18,15 @@ describe('Ghost Ajax Helper', function () {
configUtils.restore();
});
it('sets url empty if it is not set on init', function () {
ghostUrl.init({
clientId: '',
clientSecret: ''
});
ghostUrl.url.api().should.equal('');
});
it('renders basic url correctly when no arguments are presented', function () {
ghostUrl.init({
clientId: '',