Skip to content

Commit

Permalink
馃帹 Enabled Unsplash by default
Browse files Browse the repository at this point in the history
refs #8859

There are four cases:

- unsplash setting is empty (default), admin can enable the app by default (hardcoded isActive:true)
- unsplash settings are set, unsplash is disabled, admin detects that app was disabled on purpose
- unsplash setting is set, unsplash is enabled and has a key, app is enabled, old key get's ignored and overridden on the next save
- unsplash setting is set, unsplash is enabled and has no key, app is enabled
  • Loading branch information
kirrg001 authored and kevinansfield committed Sep 20, 2017
1 parent 79fead5 commit f478e4f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/server/data/schema/default-settings.json
Expand Up @@ -82,7 +82,7 @@
"defaultValue": "[{\"url\":\"\"}]"
},
"unsplash": {
"defaultValue": ""
"defaultValue": "{\"isActive\": true}"
}
},
"theme": {
Expand Down
5 changes: 5 additions & 0 deletions core/test/functional/routes/api/settings_spec.js
@@ -1,4 +1,5 @@
var should = require('should'),
_ = require('lodash'),
supertest = require('supertest'),
testUtils = require('../../../utils'),
config = require('../../../../../core/server/config'),
Expand Down Expand Up @@ -48,6 +49,10 @@ describe('Settings API', function () {
should.exist(jsonResponse);

testUtils.API.checkResponse(jsonResponse, 'settings');

JSON.parse(_.find(jsonResponse.settings, {key: 'unsplash'}).value).isActive.should.eql(true);
JSON.parse(_.find(jsonResponse.settings, {key: 'amp'}).value).should.eql(true);

done();
});
});
Expand Down

0 comments on commit f478e4f

Please sign in to comment.