From 20cce5da372882bb843d77d9fbc462a60dd0bc96 Mon Sep 17 00:00:00 2001 From: Nazar Gargol Date: Mon, 22 Jul 2019 14:35:19 +0200 Subject: [PATCH] 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 --- .../acceptance/old/admin/integrations_spec.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/core/test/acceptance/old/admin/integrations_spec.js b/core/test/acceptance/old/admin/integrations_spec.js index ee381ec3dc..542b6bd05f 100644 --- a/core/test/acceptance/old/admin/integrations_spec.js +++ b/core/test/acceptance/old/admin/integrations_spec.js @@ -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'))