Fixed fixture creation order in webhooks tests

- The tests need to have 'integrations' as a first fixture created so that webhooks can relate to an integration
This commit is contained in:
Naz 2021-03-04 12:23:31 +13:00 committed by Thibaut Patel
parent cc0a655a3d
commit f57115d3cc
3 changed files with 18 additions and 24 deletions

View File

@ -10,14 +10,12 @@ describe('Webhooks API (canary)', function () {
let request;
const API_VERSION = 'canary';
before(function () {
return ghost()
.then(function () {
request = supertest.agent(config.get('url'));
})
.then(function () {
return localUtils.doAuth(request, 'api_keys', 'webhooks');
});
before(async function () {
await ghost();
request = supertest.agent(config.get('url'));
await localUtils.doAuth(request, 'integrations', 'api_keys', 'webhooks');
});
it('Can create a webhook using integration', function () {

View File

@ -10,14 +10,12 @@ describe('Webhooks API (v2)', function () {
let request;
const API_VERSION = 'v2';
before(function () {
return ghost()
.then(function () {
request = supertest.agent(config.get('url'));
})
.then(function () {
return localUtils.doAuth(request, 'api_keys', 'webhooks');
});
before(async function () {
await ghost();
request = supertest.agent(config.get('url'));
await localUtils.doAuth(request, 'integrations', 'api_keys', 'webhooks');
});
it('Can create a webhook using integration', function () {

View File

@ -10,14 +10,12 @@ describe('Webhooks API (v3)', function () {
let request;
const API_VERSION = 'v3';
before(function () {
return ghost()
.then(function () {
request = supertest.agent(config.get('url'));
})
.then(function () {
return localUtils.doAuth(request, 'api_keys', 'webhooks');
});
before(async function () {
await ghost();
request = supertest.agent(config.get('url'));
await localUtils.doAuth(request, 'integrations', 'api_keys', 'webhooks');
});
it('Can create a webhook using integration', function () {