mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-24 14:43:08 +03:00
Renamed testUtils.startGhost to localUtils.startGhost
refs https://github.com/TryGhost/Toolbox/issues/135 - Going though local utils allows to have the "withFrontend: false" flag applied only to the e2e-api test suites. This way we can gradually introduce the no-frontend change across all test suites
This commit is contained in:
parent
9359ae923d
commit
03be383d8b
@ -9,7 +9,7 @@ describe('Actions API', function () {
|
||||
let request;
|
||||
|
||||
before(async function () {
|
||||
await testUtils.startGhost();
|
||||
await localUtils.startGhost();
|
||||
request = supertest.agent(config.get('url'));
|
||||
await localUtils.doAuth(request, 'integrations', 'api_keys');
|
||||
});
|
||||
|
@ -9,7 +9,7 @@ describe('Config API', function () {
|
||||
let request;
|
||||
|
||||
before(async function () {
|
||||
await testUtils.startGhost();
|
||||
await localUtils.startGhost();
|
||||
request = supertest.agent(config.get('url'));
|
||||
await localUtils.doAuth(request);
|
||||
});
|
||||
|
@ -10,7 +10,7 @@ describe('Custom Theme Settings API', function () {
|
||||
|
||||
before(async function () {
|
||||
// NOTE: needs force start to be able to reinitialize Ghost process with frontend services - custom-theme-settings, to be specific
|
||||
await testUtils.startGhost({
|
||||
await localUtils.startGhost({
|
||||
forceStart: true,
|
||||
withFrontend: true
|
||||
});
|
||||
|
@ -13,7 +13,7 @@ describe('DB API', function () {
|
||||
let eventsTriggered;
|
||||
|
||||
before(async function () {
|
||||
await testUtils.startGhost();
|
||||
await localUtils.startGhost();
|
||||
request = supertest.agent(config.get('url'));
|
||||
await localUtils.doAuth(request);
|
||||
});
|
||||
|
@ -10,7 +10,7 @@ describe('Email Preview API', function () {
|
||||
let request;
|
||||
|
||||
before(async function () {
|
||||
await testUtils.startGhost();
|
||||
await localUtils.startGhost();
|
||||
request = supertest.agent(config.get('url'));
|
||||
await localUtils.doAuth(request, 'users:extra', 'posts');
|
||||
});
|
||||
|
@ -8,7 +8,7 @@ describe('Email API', function () {
|
||||
let request;
|
||||
|
||||
before(async function () {
|
||||
await testUtils.startGhost();
|
||||
await localUtils.startGhost();
|
||||
request = supertest.agent(config.get('url'));
|
||||
await localUtils.doAuth(request, 'posts', 'emails');
|
||||
});
|
||||
|
@ -11,7 +11,7 @@ describe('Files API', function () {
|
||||
let request;
|
||||
|
||||
before(async function () {
|
||||
await testUtils.startGhost();
|
||||
await localUtils.startGhost();
|
||||
request = supertest.agent(config.get('url'));
|
||||
await localUtils.doAuth(request);
|
||||
});
|
||||
|
@ -11,7 +11,7 @@ describe('Images API', function () {
|
||||
let request;
|
||||
|
||||
before(async function () {
|
||||
await testUtils.startGhost();
|
||||
await localUtils.startGhost();
|
||||
request = supertest.agent(config.get('url'));
|
||||
await localUtils.doAuth(request);
|
||||
});
|
||||
|
@ -9,7 +9,7 @@ describe('Integrations API', function () {
|
||||
let request;
|
||||
|
||||
before(async function () {
|
||||
await testUtils.startGhost();
|
||||
await localUtils.startGhost();
|
||||
request = supertest.agent(config.get('url'));
|
||||
await localUtils.doAuth(request, 'integrations');
|
||||
});
|
||||
|
@ -10,7 +10,7 @@ describe('Invites API', function () {
|
||||
let request;
|
||||
|
||||
before(async function () {
|
||||
await testUtils.startGhost();
|
||||
await localUtils.startGhost();
|
||||
request = supertest.agent(config.get('url'));
|
||||
await localUtils.doAuth(request, 'invites');
|
||||
});
|
||||
|
@ -9,7 +9,7 @@ describe('Admin API key authentication', function () {
|
||||
let request;
|
||||
|
||||
before(async function () {
|
||||
await testUtils.startGhost();
|
||||
await localUtils.startGhost();
|
||||
request = supertest.agent(config.get('url'));
|
||||
await testUtils.initFixtures('api_keys');
|
||||
});
|
||||
@ -84,7 +84,7 @@ describe('Admin API key authentication', function () {
|
||||
});
|
||||
|
||||
// NOTE: need to do a full reboot to reinitialize hostSettings
|
||||
await testUtils.startGhost();
|
||||
await localUtils.startGhost();
|
||||
await testUtils.initFixtures('api_keys');
|
||||
|
||||
const response = await request.get(localUtils.API.getApiQuery('posts/'))
|
||||
|
@ -3,7 +3,7 @@ const should = require('should');
|
||||
const supertest = require('supertest');
|
||||
const sinon = require('sinon');
|
||||
const testUtils = require('../../utils');
|
||||
const localUtils = require('../../regression/api/canary/admin/utils');
|
||||
const localUtils = require('./utils');
|
||||
const config = require('../../../core/shared/config');
|
||||
|
||||
describe('Labels API', function () {
|
||||
@ -14,7 +14,7 @@ describe('Labels API', function () {
|
||||
});
|
||||
|
||||
before(async function () {
|
||||
await testUtils.startGhost();
|
||||
await localUtils.startGhost();
|
||||
request = supertest.agent(config.get('url'));
|
||||
await localUtils.doAuth(request);
|
||||
});
|
||||
|
@ -10,7 +10,7 @@ describe('Mail API', function () {
|
||||
let request;
|
||||
|
||||
before(async function () {
|
||||
await testUtils.startGhost();
|
||||
await localUtils.startGhost();
|
||||
request = supertest.agent(config.get('url'));
|
||||
await localUtils.doAuth(request, 'invites');
|
||||
});
|
||||
|
@ -12,7 +12,7 @@ describe('Media API', function () {
|
||||
let request;
|
||||
|
||||
before(async function () {
|
||||
await testUtils.startGhost();
|
||||
await localUtils.startGhost();
|
||||
request = supertest.agent(config.get('url'));
|
||||
await localUtils.doAuth(request);
|
||||
});
|
||||
|
@ -16,7 +16,7 @@ describe('Members API', function () {
|
||||
});
|
||||
|
||||
before(async function () {
|
||||
await testUtils.startGhost();
|
||||
await localUtils.startGhost();
|
||||
request = supertest.agent(config.get('url'));
|
||||
await localUtils.doAuth(request, 'members', 'members:emails');
|
||||
sinon.stub(labs, 'isSet').withArgs('members').returns(true);
|
||||
|
@ -8,7 +8,7 @@ describe('Notifications API', function () {
|
||||
let request;
|
||||
|
||||
before(async function () {
|
||||
await testUtils.startGhost();
|
||||
await localUtils.startGhost();
|
||||
request = supertest.agent(config.get('url'));
|
||||
await localUtils.doAuth(request);
|
||||
});
|
||||
|
@ -13,7 +13,7 @@ describe('Oembed API', function () {
|
||||
let request;
|
||||
|
||||
before(async function () {
|
||||
await testUtils.startGhost();
|
||||
await localUtils.startGhost();
|
||||
request = supertest.agent(config.get('url'));
|
||||
await localUtils.doAuth(request);
|
||||
});
|
||||
|
@ -10,7 +10,7 @@ describe('Pages API', function () {
|
||||
let request;
|
||||
|
||||
before(async function () {
|
||||
await testUtils.startGhost();
|
||||
await localUtils.startGhost();
|
||||
request = supertest.agent(config.get('url'));
|
||||
await localUtils.doAuth(request, 'users:extra', 'posts');
|
||||
});
|
||||
|
@ -15,7 +15,7 @@ describe('Posts API', function () {
|
||||
let request;
|
||||
|
||||
before(async function () {
|
||||
await testUtils.startGhost();
|
||||
await localUtils.startGhost();
|
||||
request = supertest.agent(config.get('url'));
|
||||
await localUtils.doAuth(request, 'users:extra', 'posts', 'emails');
|
||||
});
|
||||
@ -387,7 +387,7 @@ describe('Posts API', function () {
|
||||
});
|
||||
|
||||
// NOTE: need to do a full reboot to reinitialize hostSettings
|
||||
await testUtils.startGhost();
|
||||
await localUtils.startGhost();
|
||||
request = supertest.agent(config.get('url'));
|
||||
await localUtils.doAuth(request, 'users:extra', 'posts', 'emails');
|
||||
|
||||
|
@ -8,7 +8,7 @@ describe('Roles API', function () {
|
||||
let request;
|
||||
|
||||
before(async function () {
|
||||
await testUtils.startGhost();
|
||||
await localUtils.startGhost();
|
||||
request = supertest.agent(config.get('url'));
|
||||
await localUtils.doAuth(request, 'posts');
|
||||
});
|
||||
|
@ -13,7 +13,7 @@ describe('Settings API', function () {
|
||||
let ghostServer;
|
||||
|
||||
before(async function () {
|
||||
ghostServer = await testUtils.startGhost();
|
||||
ghostServer = await localUtils.startGhost();
|
||||
request = supertest.agent(config.get('url'));
|
||||
await localUtils.doAuth(request);
|
||||
});
|
||||
|
@ -8,7 +8,7 @@ describe('Slug API', function () {
|
||||
let request;
|
||||
|
||||
before(async function () {
|
||||
await testUtils.startGhost();
|
||||
await localUtils.startGhost();
|
||||
request = supertest.agent(config.get('url'));
|
||||
await localUtils.doAuth(request);
|
||||
});
|
||||
|
@ -14,7 +14,7 @@ describe('Snippets API', function () {
|
||||
});
|
||||
|
||||
before(async function () {
|
||||
await testUtils.startGhost();
|
||||
await localUtils.startGhost();
|
||||
request = supertest.agent(config.get('url'));
|
||||
await localUtils.doAuth(request, 'snippets');
|
||||
});
|
||||
|
@ -8,7 +8,7 @@ describe('Tag API', function () {
|
||||
let request;
|
||||
|
||||
before(async function () {
|
||||
await testUtils.startGhost();
|
||||
await localUtils.startGhost();
|
||||
request = supertest.agent(config.get('url'));
|
||||
await localUtils.doAuth(request, 'posts');
|
||||
});
|
||||
|
@ -26,7 +26,7 @@ describe('Themes API', function () {
|
||||
};
|
||||
|
||||
before(async function () {
|
||||
await testUtils.startGhost({
|
||||
await localUtils.startGhost({
|
||||
forceStart: true, // NOTE: this flag should not be here! the URL service re-initialization should be fixe instead
|
||||
withFrontend: true
|
||||
});
|
||||
|
@ -13,7 +13,7 @@ describe('User API', function () {
|
||||
let admin;
|
||||
|
||||
before(async function () {
|
||||
await testUtils.startGhost();
|
||||
await localUtils.startGhost();
|
||||
request = supertest.agent(config.get('url'));
|
||||
|
||||
// create inactive user
|
||||
|
@ -9,7 +9,7 @@ describe('Webhooks API', function () {
|
||||
const API_VERSION = 'canary';
|
||||
|
||||
before(async function () {
|
||||
await testUtils.startGhost();
|
||||
await localUtils.startGhost();
|
||||
request = supertest.agent(config.get('url'));
|
||||
await localUtils.doAuth(request, 'integrations');
|
||||
});
|
||||
|
@ -12,7 +12,7 @@ describe('Authors Content API', function () {
|
||||
let request;
|
||||
|
||||
before(async function () {
|
||||
await testUtils.startGhost();
|
||||
await localUtils.startGhost();
|
||||
request = supertest.agent(config.get('url'));
|
||||
await testUtils.initFixtures('owner:post', 'users:no-owner', 'user:inactive', 'posts', 'api_keys');
|
||||
});
|
||||
|
@ -9,7 +9,7 @@ describe('Content API key authentication', function () {
|
||||
let request;
|
||||
|
||||
before(async function () {
|
||||
await testUtils.startGhost();
|
||||
await localUtils.startGhost();
|
||||
request = supertest.agent(config.get('url'));
|
||||
await testUtils.initFixtures('api_keys');
|
||||
});
|
||||
@ -44,7 +44,7 @@ describe('Content API key authentication', function () {
|
||||
});
|
||||
|
||||
// NOTE: need to do a full reboot to reinitialize hostSettings
|
||||
await testUtils.startGhost();
|
||||
await localUtils.startGhost();
|
||||
await testUtils.initFixtures('api_keys');
|
||||
|
||||
const key = localUtils.getValidKey();
|
||||
|
@ -10,7 +10,7 @@ describe('Pages Content API', function () {
|
||||
let request;
|
||||
|
||||
before(async function () {
|
||||
await testUtils.startGhost();
|
||||
await localUtils.startGhost();
|
||||
request = supertest.agent(config.get('url'));
|
||||
await testUtils.initFixtures('users:no-owner', 'user:inactive', 'posts', 'tags:extra', 'api_keys');
|
||||
});
|
||||
|
@ -13,7 +13,7 @@ describe('Posts Content API', function () {
|
||||
let request;
|
||||
|
||||
before(async function () {
|
||||
await testUtils.startGhost();
|
||||
await localUtils.startGhost();
|
||||
request = supertest.agent(config.get('url'));
|
||||
await testUtils.initFixtures('owner:post', 'users:no-owner', 'user:inactive', 'posts', 'tags:extra', 'api_keys');
|
||||
});
|
||||
|
@ -41,7 +41,7 @@ describe('Settings Content API', function () {
|
||||
let request;
|
||||
|
||||
before(async function () {
|
||||
await testUtils.startGhost();
|
||||
await localUtils.startGhost();
|
||||
request = supertest.agent(config.get('url'));
|
||||
await testUtils.initFixtures('api_keys');
|
||||
});
|
||||
|
@ -11,7 +11,7 @@ describe('Tags Content API', function () {
|
||||
let request;
|
||||
|
||||
before(async function () {
|
||||
await testUtils.startGhost();
|
||||
await localUtils.startGhost();
|
||||
request = supertest.agent(config.get('url'));
|
||||
await testUtils.initFixtures('users:no-owner', 'user:inactive', 'posts', 'tags:extra', 'api_keys');
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user