mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 05:37:34 +03:00
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:
parent
496f873ac4
commit
20cce5da37
@ -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'))
|
||||
|
Loading…
Reference in New Issue
Block a user