0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

Cleaned up weird refs to versions in tests

refs: https://github.com/TryGhost/Toolbox/issues/168

- These are all places where we reference an API version like v2 or v3 but it's not actually
used or relevant.
- The aim is to get rid of all mentions of these old versions to make it clearer that we're only running tests on canary
This commit is contained in:
Hannah Wolfe 2022-01-21 12:47:25 +00:00
parent e47b55b466
commit 12e8c974a1
No known key found for this signature in database
GPG key ID: AB586C3B5AE5C037
6 changed files with 7 additions and 42 deletions

View file

@ -164,7 +164,7 @@ describe('DB API (canary)', function () {
.expect(200);
});
it('Can import a JSON database exported from Ghost v2', async function () {
it('Can import a JSON database exported from Ghost 2.x', async function () {
await request.delete(localUtils.API.getApiQuery('db/'))
.set('Origin', config.get('url'))
.set('Accept', 'application/json')
@ -211,7 +211,7 @@ describe('DB API (canary)', function () {
usersResponse.body.users.should.have.length(3);
});
it('Can import a JSON database exported from Ghost 3.0', async function () {
it('Can import a JSON database exported from Ghost 3.x', async function () {
await request.delete(localUtils.API.getApiQuery('db/'))
.set('Origin', config.get('url'))
.set('Accept', 'application/json')
@ -258,7 +258,7 @@ describe('DB API (canary)', function () {
usersResponse.body.users.should.have.length(3);
});
it('Can import a JSON database exported from Ghost 4.0', async function () {
it('Can import a JSON database exported from Ghost 4.x', async function () {
await request.delete(localUtils.API.getApiQuery('db/'))
.set('Origin', config.get('url'))
.set('Accept', 'application/json')

View file

@ -1,7 +1,7 @@
const should = require('should');
const shared = require('../../../../../../core/server/api/shared');
describe('Unit: v2/utils/serializers/input/all', function () {
describe('Unit: utils/serializers/input/all', function () {
describe('all', function () {
it('transforms into model readable format', function () {
const apiConfig = {};

View file

@ -1,17 +0,0 @@
const should = require('should');
const sinon = require('sinon');
const urlUtils = require('../../../../../../../core/shared/url-utils');
const url = require('../../../../../../../core/server/api/v2/utils/serializers/input/utils/url');
describe('Unit: v2/utils/serializers/input/utils/url', function () {
describe('forPost', function () {
beforeEach(function () {
sinon.stub(urlUtils, 'getSiteUrl')
.returns('https://blogurl.com');
});
afterEach(function () {
sinon.restore();
});
});
});

View file

@ -133,25 +133,7 @@ describe('{{body_class}} helper', function () {
rendered.string.should.equal('post-template tag-foo tag-bar');
});
it('v2: a static page', function () {
const rendered = callBodyClassWithContext(
['page'],
{relativeUrl: '/about', page: {page: true, slug: 'about'}}
);
rendered.string.should.equal('page-template page-about');
});
it('canary: a static page', function () {
const rendered = callBodyClassWithContext(
['page'],
{relativeUrl: '/about', page: {page: true, slug: 'about'}}
);
rendered.string.should.equal('page-template page-about');
});
it('v3: a static page', function () {
it('a static page', function () {
const rendered = callBodyClassWithContext(
['page'],
{relativeUrl: '/about', page: {page: true, slug: 'about'}}

View file

@ -638,7 +638,7 @@ describe('getMetaDescription', function () {
});
});
it('v3: should return data page meta description if on root context contains page', function () {
it('should return data page meta description if on root context contains page', function () {
const description = getMetaDescription({
page: {
meta_description: 'Best page ever!'

View file

@ -127,7 +127,7 @@ describe('Middleware: uncapitalise', function () {
});
describe('An API request', function () {
['v0.1', 'v2', 'v3', 'canary', 'v10'].forEach((apiVersion) => {
['v0.1', 'canary', 'v10'].forEach((apiVersion) => {
describe(`for ${apiVersion}`, function () {
it('does nothing if there are no capitals', function (done) {
req.path = `/ghost/api/${apiVersion}/endpoint/`;