0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Moved email preview spec to acceptance tests

- Tests here are baseline usecases which should be always in check
- More edge case scenarios might go into regression suite in the future
This commit is contained in:
Nazar Gargol 2019-11-08 11:37:53 +07:00
parent ed2f9e499c
commit 13a0108aac
3 changed files with 8 additions and 12 deletions

View file

@ -1,32 +1,27 @@
const should = require('should');
const supertest = require('supertest');
const ObjectId = require('bson-objectid');
const testUtils = require('../../../../utils');
const config = require('../../../../../server/config');
const testUtils = require('../../utils');
const localUtils = require('./utils');
const config = require('../../../server/config');
const ghost = testUtils.startGhost;
let request;
describe('Email Preview API', function () {
let ghostServer;
let ownerCookie;
let request;
before(function () {
return ghost()
.then(function (_ghostServer) {
ghostServer = _ghostServer;
request = supertest.agent(config.get('url'));
})
.then(function () {
return localUtils.doAuth(request, 'users:extra', 'posts');
})
.then(function (cookie) {
ownerCookie = cookie;
});
});
describe('Read', function () {
it('can\'t retrieve non existent post', function (done) {
it('can\'t retrieve for non existent post', function (done) {
request.get(localUtils.API.getApiQuery(`posts/${ObjectId.generate()}/`))
.set('Origin', config.get('url'))
.set('Accept', 'application/json')

View file

@ -103,7 +103,8 @@ const expectedProperties = {
.keys()
,
email: _(schema.emails)
.keys()
.keys(),
email_preview: ['html', 'subject', 'plaintext']
};
_.each(expectedProperties, (value, key) => {

View file

@ -71,7 +71,7 @@ const expectedProperties = {
webhook: _(schema.webhooks)
.keys()
,
email_preview: ['html', 'subject']
email_preview: ['html', 'subject', 'plaintext']
};
_.each(expectedProperties, (value, key) => {