mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Updated fixtures for Ghost v4.0
- With 4.0 we have a brand new version of Casper, new fixtures and new default settings - Fixture posts cover the key features and give users an introduction to how to use their site - This all comes from the marketing and design teams to refresh the look and feel of Ghost and give users the best possible onboarding experience Note: this fixture overhaul includes - new content for new 4.0 features - regenerated post content using our updated mobiledoc structure - a switch from British to US English
This commit is contained in:
parent
ec9988af77
commit
fdc043227a
13 changed files with 156 additions and 110 deletions
File diff suppressed because one or more lines are too long
|
@ -26,7 +26,7 @@ describe('Pages API', function () {
|
|||
const jsonResponse = res.body;
|
||||
should.exist(jsonResponse.pages);
|
||||
localUtils.API.checkResponse(jsonResponse, 'pages');
|
||||
jsonResponse.pages.should.have.length(2);
|
||||
jsonResponse.pages.should.have.length(6);
|
||||
|
||||
localUtils.API.checkResponse(jsonResponse.pages[0], 'page');
|
||||
localUtils.API.checkResponse(jsonResponse.meta.pagination, 'pagination');
|
||||
|
@ -34,7 +34,7 @@ describe('Pages API', function () {
|
|||
|
||||
// Absolute urls by default
|
||||
jsonResponse.pages[0].url.should.match(new RegExp(`${config.get('url')}/p/[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}`));
|
||||
jsonResponse.pages[1].url.should.eql(`${config.get('url')}/static-page-test/`);
|
||||
jsonResponse.pages[1].url.should.eql(`${config.get('url')}/contribute/`);
|
||||
});
|
||||
|
||||
it('Can add a page', async function () {
|
||||
|
|
|
@ -72,7 +72,7 @@ describe('Posts API', function () {
|
|||
_.isBoolean(jsonResponse.posts[0].featured).should.eql(true);
|
||||
|
||||
// ensure order works
|
||||
jsonResponse.posts[0].slug.should.eql('apps-integrations');
|
||||
jsonResponse.posts[0].slug.should.eql('portal');
|
||||
});
|
||||
|
||||
it('Can include single relation', async function () {
|
||||
|
|
|
@ -34,9 +34,9 @@ describe('Pages Content API', function () {
|
|||
const jsonResponse = res.body;
|
||||
should.exist(jsonResponse.pages);
|
||||
should.exist(jsonResponse.meta);
|
||||
jsonResponse.pages.should.have.length(1);
|
||||
jsonResponse.pages.should.have.length(5);
|
||||
|
||||
res.body.pages[0].slug.should.eql(testUtils.DataGenerator.Content.posts[5].slug);
|
||||
res.body.pages[0].slug.should.eql('about');
|
||||
|
||||
const urlParts = url.parse(res.body.pages[0].url);
|
||||
should.exist(urlParts.protocol);
|
||||
|
|
|
@ -45,7 +45,7 @@ describe('Posts Content API', function () {
|
|||
|
||||
// Default order 'published_at desc' check
|
||||
jsonResponse.posts[0].slug.should.eql('welcome');
|
||||
jsonResponse.posts[6].slug.should.eql('themes');
|
||||
jsonResponse.posts[6].slug.should.eql('integrations');
|
||||
|
||||
// check meta response for this test
|
||||
jsonResponse.meta.pagination.page.should.eql(1);
|
||||
|
@ -245,7 +245,7 @@ describe('Posts Content API', function () {
|
|||
const post = res.body.posts[0];
|
||||
const publishedAt = moment(post.published_at).format('YYYY-MM-DD HH:mm:ss');
|
||||
|
||||
post.title.should.eql('Welcome to Ghost');
|
||||
post.title.should.eql('Start here for a quick overview of everything you need to know');
|
||||
|
||||
const res2 = await request
|
||||
.get(localUtils.API.getApiQuery(`posts/?key=${validKey}&limit=1&filter=${createFilter(publishedAt, `<`)}`))
|
||||
|
@ -258,7 +258,7 @@ describe('Posts Content API', function () {
|
|||
const post2 = res2.body.posts[0];
|
||||
const publishedAt2 = moment(post2.published_at).format('YYYY-MM-DD HH:mm:ss');
|
||||
|
||||
post2.title.should.eql('Writing posts with Ghost ✍️');
|
||||
post2.title.should.eql('Customizing your brand and design settings');
|
||||
|
||||
const res3 = await request
|
||||
.get(localUtils.API.getApiQuery(`posts/?key=${validKey}&limit=1&filter=${createFilter(publishedAt2, `>`)}`))
|
||||
|
@ -270,7 +270,7 @@ describe('Posts Content API', function () {
|
|||
should.exist(res3.body.posts[0]);
|
||||
const post3 = res3.body.posts[0];
|
||||
|
||||
post3.title.should.eql('Welcome to Ghost');
|
||||
post3.title.should.eql('Start here for a quick overview of everything you need to know');
|
||||
});
|
||||
|
||||
it('Can request a single post', async function () {
|
||||
|
|
|
@ -122,7 +122,7 @@ describe('Default Frontend routing', function () {
|
|||
const $ = cheerio.load(res.text);
|
||||
|
||||
// NOTE: This is the title from the settings.
|
||||
$('title').text().should.equal('Welcome to Ghost');
|
||||
$('title').text().should.equal('Start here for a quick overview of everything you need to know');
|
||||
|
||||
$('body.post-template').length.should.equal(1);
|
||||
$('body.tag-getting-started').length.should.equal(1);
|
||||
|
@ -198,7 +198,7 @@ describe('Default Frontend routing', function () {
|
|||
|
||||
const $ = cheerio.load(res.text);
|
||||
|
||||
$('.post-title').text().should.equal('Welcome to Ghost');
|
||||
$('.post-title').text().should.equal('Start here for a quick overview of everything you need to know');
|
||||
|
||||
$('.content .post').length.should.equal(1);
|
||||
$('.powered').text().should.equal(' Published with Ghost');
|
||||
|
@ -245,7 +245,7 @@ describe('Default Frontend routing', function () {
|
|||
.expect('Cache-Control', testUtils.cacheRules.public)
|
||||
.expect('Content-Type', 'text/xml; charset=utf-8');
|
||||
|
||||
res.text.should.match(/<!\[CDATA\[Welcome to Ghost\]\]>/);
|
||||
res.text.should.match(/<!\[CDATA\[Start here for a quick overview of everything you need to know\]\]>/);
|
||||
doEnd(res);
|
||||
});
|
||||
|
||||
|
@ -255,7 +255,7 @@ describe('Default Frontend routing', function () {
|
|||
.expect('Cache-Control', testUtils.cacheRules.public)
|
||||
.expect('Content-Type', 'text/xml; charset=utf-8');
|
||||
|
||||
res.text.should.match(/<!\[CDATA\[Welcome to Ghost\]\]>/);
|
||||
res.text.should.match(/<!\[CDATA\[Start here for a quick overview of everything you need to know\]\]>/);
|
||||
doEnd(res);
|
||||
});
|
||||
|
||||
|
@ -265,7 +265,7 @@ describe('Default Frontend routing', function () {
|
|||
.expect('Cache-Control', testUtils.cacheRules.public)
|
||||
.expect('Content-Type', 'text/xml; charset=utf-8');
|
||||
|
||||
res.text.should.match(/<!\[CDATA\[Welcome to Ghost\]\]>/);
|
||||
res.text.should.match(/<!\[CDATA\[Start here for a quick overview of everything you need to know\]\]>/);
|
||||
doEnd(res);
|
||||
});
|
||||
});
|
||||
|
@ -412,7 +412,7 @@ describe('Default Frontend routing', function () {
|
|||
.expect('Cache-Control', testUtils.cacheRules.private)
|
||||
.expect('Content-Type', 'text/xml; charset=utf-8');
|
||||
|
||||
res.text.should.match(/<!\[CDATA\[Welcome to Ghost\]\]>/);
|
||||
res.text.should.match(/<!\[CDATA\[Start here for a quick overview of everything you need to know\]\]>/);
|
||||
doEnd(res);
|
||||
});
|
||||
|
||||
|
@ -422,7 +422,7 @@ describe('Default Frontend routing', function () {
|
|||
.expect('Cache-Control', testUtils.cacheRules.private)
|
||||
.expect('Content-Type', 'text/xml; charset=utf-8');
|
||||
|
||||
res.text.should.match(/<!\[CDATA\[Welcome to Ghost\]\]>/);
|
||||
res.text.should.match(/<!\[CDATA\[Start here for a quick overview of everything you need to know\]\]>/);
|
||||
doEnd(res);
|
||||
});
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ describe('api/canary/content/posts', function () {
|
|||
|
||||
// Default order 'published_at desc' check
|
||||
jsonResponse.posts[0].slug.should.eql('welcome');
|
||||
jsonResponse.posts[6].slug.should.eql('themes');
|
||||
jsonResponse.posts[6].slug.should.eql('integrations');
|
||||
|
||||
// check meta response for this test
|
||||
jsonResponse.meta.pagination.page.should.eql(1);
|
||||
|
@ -103,7 +103,7 @@ describe('api/canary/content/posts', function () {
|
|||
|
||||
// Default order 'published_at desc' check
|
||||
jsonResponse.posts[0].slug.should.eql('welcome');
|
||||
jsonResponse.posts[6].slug.should.eql('themes');
|
||||
jsonResponse.posts[6].slug.should.eql('integrations');
|
||||
|
||||
// check meta response for this test
|
||||
jsonResponse.meta.pagination.page.should.eql(1);
|
||||
|
@ -180,7 +180,7 @@ describe('api/canary/content/posts', function () {
|
|||
});
|
||||
|
||||
it('browse posts with slug filter, should order in slug order', function () {
|
||||
return request.get(localUtils.API.getApiQuery(`posts/?key=${validKey}&filter=slug:[themes,ghostly-kitchen-sink,the-editor]`))
|
||||
return request.get(localUtils.API.getApiQuery(`posts/?key=${validKey}&filter=slug:[write,ghostly-kitchen-sink,grow]`))
|
||||
.expect('Content-Type', /json/)
|
||||
.expect('Cache-Control', testUtils.cacheRules.private)
|
||||
.expect(200)
|
||||
|
@ -188,14 +188,14 @@ describe('api/canary/content/posts', function () {
|
|||
const jsonResponse = res.body;
|
||||
|
||||
jsonResponse.posts.should.be.an.Array().with.lengthOf(3);
|
||||
jsonResponse.posts[0].slug.should.equal('themes');
|
||||
jsonResponse.posts[0].slug.should.equal('write');
|
||||
jsonResponse.posts[1].slug.should.equal('ghostly-kitchen-sink');
|
||||
jsonResponse.posts[2].slug.should.equal('the-editor');
|
||||
jsonResponse.posts[2].slug.should.equal('grow');
|
||||
});
|
||||
});
|
||||
|
||||
it('browse posts with slug filter should order taking order parameter into account', function () {
|
||||
return request.get(localUtils.API.getApiQuery(`posts/?key=${validKey}&order=slug%20DESC&filter=slug:[themes,ghostly-kitchen-sink,the-editor]`))
|
||||
return request.get(localUtils.API.getApiQuery(`posts/?key=${validKey}&order=slug%20DESC&filter=slug:[write,ghostly-kitchen-sink,grow]`))
|
||||
.expect('Content-Type', /json/)
|
||||
.expect('Cache-Control', testUtils.cacheRules.private)
|
||||
.expect(200)
|
||||
|
@ -203,8 +203,8 @@ describe('api/canary/content/posts', function () {
|
|||
const jsonResponse = res.body;
|
||||
|
||||
jsonResponse.posts.should.be.an.Array().with.lengthOf(3);
|
||||
jsonResponse.posts[0].slug.should.equal('themes');
|
||||
jsonResponse.posts[1].slug.should.equal('the-editor');
|
||||
jsonResponse.posts[0].slug.should.equal('write');
|
||||
jsonResponse.posts[1].slug.should.equal('grow');
|
||||
jsonResponse.posts[2].slug.should.equal('ghostly-kitchen-sink');
|
||||
});
|
||||
});
|
||||
|
@ -417,7 +417,7 @@ describe('api/canary/content/posts', function () {
|
|||
jsonResponse.posts[1].slug.should.eql('thou-shalt-be-paid-for');
|
||||
jsonResponse.posts[2].slug.should.eql('free-to-see');
|
||||
jsonResponse.posts[3].slug.should.eql('thou-shalt-have-a-taste');
|
||||
jsonResponse.posts[8].slug.should.eql('organising-content');
|
||||
jsonResponse.posts[8].slug.should.eql('sell');
|
||||
|
||||
jsonResponse.posts[0].html.should.eql('');
|
||||
jsonResponse.posts[1].html.should.eql('');
|
||||
|
|
|
@ -39,9 +39,9 @@ describe('api/v2/content/pages', function () {
|
|||
const jsonResponse = res.body;
|
||||
should.exist(jsonResponse.pages);
|
||||
should.exist(jsonResponse.meta);
|
||||
jsonResponse.pages.should.have.length(1);
|
||||
jsonResponse.pages.should.have.length(5);
|
||||
|
||||
res.body.pages[0].slug.should.eql(testUtils.DataGenerator.Content.posts[5].slug);
|
||||
res.body.pages[0].slug.should.eql('about');
|
||||
|
||||
const urlParts = url.parse(res.body.pages[0].url);
|
||||
should.exist(urlParts.protocol);
|
||||
|
|
|
@ -58,7 +58,7 @@ describe('api/v2/content/posts', function () {
|
|||
|
||||
// Default order 'published_at desc' check
|
||||
jsonResponse.posts[0].slug.should.eql('welcome');
|
||||
jsonResponse.posts[6].slug.should.eql('themes');
|
||||
jsonResponse.posts[6].slug.should.eql('integrations');
|
||||
|
||||
// check meta response for this test
|
||||
jsonResponse.meta.pagination.page.should.eql(1);
|
||||
|
@ -367,7 +367,7 @@ describe('api/v2/content/posts', function () {
|
|||
jsonResponse.posts[1].slug.should.eql('thou-shalt-be-paid-for');
|
||||
jsonResponse.posts[2].slug.should.eql('free-to-see');
|
||||
jsonResponse.posts[3].slug.should.eql('thou-shalt-have-a-taste');
|
||||
jsonResponse.posts[8].slug.should.eql('organising-content');
|
||||
jsonResponse.posts[8].slug.should.eql('sell');
|
||||
|
||||
jsonResponse.posts[0].html.should.eql('');
|
||||
jsonResponse.posts[1].html.should.eql('');
|
||||
|
|
|
@ -56,7 +56,7 @@ describe('api/v3/content/posts', function () {
|
|||
|
||||
// Default order 'published_at desc' check
|
||||
jsonResponse.posts[0].slug.should.eql('welcome');
|
||||
jsonResponse.posts[6].slug.should.eql('themes');
|
||||
jsonResponse.posts[6].slug.should.eql('integrations');
|
||||
|
||||
// check meta response for this test
|
||||
jsonResponse.meta.pagination.page.should.eql(1);
|
||||
|
@ -103,7 +103,7 @@ describe('api/v3/content/posts', function () {
|
|||
|
||||
// Default order 'published_at desc' check
|
||||
jsonResponse.posts[0].slug.should.eql('welcome');
|
||||
jsonResponse.posts[6].slug.should.eql('themes');
|
||||
jsonResponse.posts[6].slug.should.eql('integrations');
|
||||
|
||||
// check meta response for this test
|
||||
jsonResponse.meta.pagination.page.should.eql(1);
|
||||
|
@ -180,7 +180,7 @@ describe('api/v3/content/posts', function () {
|
|||
});
|
||||
|
||||
it('browse posts with slug filter, should order in slug order', function () {
|
||||
return request.get(localUtils.API.getApiQuery(`posts/?key=${validKey}&filter=slug:[themes,ghostly-kitchen-sink,the-editor]`))
|
||||
return request.get(localUtils.API.getApiQuery(`posts/?key=${validKey}&filter=slug:[write,ghostly-kitchen-sink,grow]`))
|
||||
.expect('Content-Type', /json/)
|
||||
.expect('Cache-Control', testUtils.cacheRules.private)
|
||||
.expect(200)
|
||||
|
@ -188,14 +188,14 @@ describe('api/v3/content/posts', function () {
|
|||
const jsonResponse = res.body;
|
||||
|
||||
jsonResponse.posts.should.be.an.Array().with.lengthOf(3);
|
||||
jsonResponse.posts[0].slug.should.equal('themes');
|
||||
jsonResponse.posts[0].slug.should.equal('write');
|
||||
jsonResponse.posts[1].slug.should.equal('ghostly-kitchen-sink');
|
||||
jsonResponse.posts[2].slug.should.equal('the-editor');
|
||||
jsonResponse.posts[2].slug.should.equal('grow');
|
||||
});
|
||||
});
|
||||
|
||||
it('browse posts with slug filter should order taking order parameter into account', function () {
|
||||
return request.get(localUtils.API.getApiQuery(`posts/?key=${validKey}&order=slug%20DESC&filter=slug:[themes,ghostly-kitchen-sink,the-editor]`))
|
||||
return request.get(localUtils.API.getApiQuery(`posts/?key=${validKey}&order=slug%20DESC&filter=slug:[write,ghostly-kitchen-sink,grow]`))
|
||||
.expect('Content-Type', /json/)
|
||||
.expect('Cache-Control', testUtils.cacheRules.private)
|
||||
.expect(200)
|
||||
|
@ -203,8 +203,8 @@ describe('api/v3/content/posts', function () {
|
|||
const jsonResponse = res.body;
|
||||
|
||||
jsonResponse.posts.should.be.an.Array().with.lengthOf(3);
|
||||
jsonResponse.posts[0].slug.should.equal('themes');
|
||||
jsonResponse.posts[1].slug.should.equal('the-editor');
|
||||
jsonResponse.posts[0].slug.should.equal('write');
|
||||
jsonResponse.posts[1].slug.should.equal('grow');
|
||||
jsonResponse.posts[2].slug.should.equal('ghostly-kitchen-sink');
|
||||
});
|
||||
});
|
||||
|
@ -416,7 +416,7 @@ describe('api/v3/content/posts', function () {
|
|||
jsonResponse.posts[1].slug.should.eql('thou-shalt-be-paid-for');
|
||||
jsonResponse.posts[2].slug.should.eql('free-to-see');
|
||||
jsonResponse.posts[3].slug.should.eql('thou-shalt-have-a-taste');
|
||||
jsonResponse.posts[8].slug.should.eql('organising-content');
|
||||
jsonResponse.posts[8].slug.should.eql('sell');
|
||||
|
||||
jsonResponse.posts[0].html.should.eql('');
|
||||
jsonResponse.posts[1].html.should.eql('');
|
||||
|
|
|
@ -249,8 +249,8 @@ describe('Database Migration (special functions)', function () {
|
|||
// Post
|
||||
should.exist(result.posts);
|
||||
result.posts.length.should.eql(7);
|
||||
result.posts.at(0).get('title').should.eql('Welcome to Ghost');
|
||||
result.posts.at(6).get('title').should.eql('Creating a custom theme');
|
||||
result.posts.at(0).get('title').should.eql('Start here for a quick overview of everything you need to know');
|
||||
result.posts.at(6).get('title').should.eql('Setting up apps and custom integrations');
|
||||
|
||||
// Tag
|
||||
should.exist(result.tags);
|
||||
|
|
|
@ -103,11 +103,11 @@ describe('Migration Fixture Utils', function () {
|
|||
fixtureUtils.addFixturesForModel(fixtures.models[4]).then(function (result) {
|
||||
should.exist(result);
|
||||
result.should.be.an.Object();
|
||||
result.should.have.property('expected', 7);
|
||||
result.should.have.property('done', 7);
|
||||
result.should.have.property('expected', 11);
|
||||
result.should.have.property('done', 11);
|
||||
|
||||
postOneStub.callCount.should.eql(7);
|
||||
postAddStub.callCount.should.eql(7);
|
||||
postOneStub.callCount.should.eql(11);
|
||||
postAddStub.callCount.should.eql(11);
|
||||
|
||||
done();
|
||||
}).catch(done);
|
||||
|
@ -120,10 +120,10 @@ describe('Migration Fixture Utils', function () {
|
|||
fixtureUtils.addFixturesForModel(fixtures.models[4]).then(function (result) {
|
||||
should.exist(result);
|
||||
result.should.be.an.Object();
|
||||
result.should.have.property('expected', 7);
|
||||
result.should.have.property('expected', 11);
|
||||
result.should.have.property('done', 0);
|
||||
|
||||
postOneStub.callCount.should.eql(7);
|
||||
postOneStub.callCount.should.eql(11);
|
||||
postAddStub.callCount.should.eql(0);
|
||||
|
||||
done();
|
||||
|
|
|
@ -33,7 +33,7 @@ const defaultSettings = require('../../../../core/server/data/schema/default-set
|
|||
describe('DB version integrity', function () {
|
||||
// Only these variables should need updating
|
||||
const currentSchemaHash = '559cdbb49a7eeb5758caf0c6e3bf790d';
|
||||
const currentFixturesHash = '5f6f69931811c407dff01da9ef9667f4';
|
||||
const currentFixturesHash = '05a291a44821aa340a91796b4c101575';
|
||||
const currentSettingsHash = '7ac732b994a5bb1565f88c8a84872964';
|
||||
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue