Added test coverage for integrations Admin API endpoint

no issue

- The basic test coverate for 'browse' endpoint for integrations was missing.
- It case is needed to be able to expand it in https://github.com/TryGhost/Ghost/pull/10501
This commit is contained in:
Nazar Gargol 2019-07-22 14:35:19 +02:00
parent 496f873ac4
commit 20cce5da37

View File

@ -21,6 +21,24 @@ describe('Integrations API', function () {
const findBy = (prop, val) => object => object[prop] === val;
it('Can browse all integrations', function (done) {
request.get(localUtils.API.getApiQuery(`integrations/`))
.set('Origin', config.get('url'))
.expect('Content-Type', /json/)
.expect('Cache-Control', testUtils.cacheRules.private)
.expect(200)
.end(function (err, {body}) {
if (err) {
return done(err);
}
should.equal(body.integrations.length, 2);
should.equal(body.integrations[0].name, 'Zapier');
should.equal(body.integrations[1].name, 'Test Integration');
done();
});
});
it('Can successfully create a single integration with auto generated content and admin api key', function (done) {
request.post(localUtils.API.getApiQuery('integrations/'))
.set('Origin', config.get('url'))