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

Enable Public API by default (#8600)

closes #8601 

- this doesn't take the feature out of beta, but does enable it by default
- no need to enable the public api in the test anymore
- because public api is enabled by default
This commit is contained in:
Hannah Wolfe 2017-06-20 04:10:49 +01:00 committed by Aileen Nowak
parent c3dbd0e56b
commit 2058127dc5
2 changed files with 5 additions and 23 deletions

View file

@ -73,7 +73,7 @@
"defaultValue" : ""
},
"labs": {
"defaultValue": "{}"
"defaultValue": "{\"publicAPI\": true}"
},
"navigation": {
"defaultValue": "[{\"label\":\"Home\", \"url\":\"/\"}]"

View file

@ -7,37 +7,19 @@ var should = require('should'),
request;
describe('Public API', function () {
var publicAPIaccessSetting = {
settings: [
{key: 'labs', value: {publicAPI: true}}
]
}, ghostServer;
var ghostServer;
before(function (done) {
before(function () {
// starting ghost automatically populates the db
// TODO: prevent db init, and manage bringing up the DB with fixtures ourselves
ghost().then(function (_ghostServer) {
return ghost().then(function (_ghostServer) {
ghostServer = _ghostServer;
return ghostServer.start();
}).then(function () {
request = supertest.agent(config.get('url'));
}).then(function () {
return testUtils.doAuth(request, 'posts', 'tags', 'client:trusted-domain');
}).then(function (token) {
// enable public API
request.put(testUtils.API.getApiQuery('settings/'))
.set('Authorization', 'Bearer ' + token)
.send(publicAPIaccessSetting)
.expect('Content-Type', /json/)
.expect('Cache-Control', testUtils.cacheRules.private)
.expect(200)
.end(function (err) {
if (err) {
return done(err);
}
done();
});
}).catch(done);
});
});
after(function () {