mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Added regression test for editing a scheduled post
refs #10600 - ensure it does not happen again - we only have some regression model tests, which edit scheduled posts
This commit is contained in:
parent
f6f35ebcd0
commit
7bac1824c2
1 changed files with 26 additions and 0 deletions
|
@ -210,6 +210,32 @@ describe('Posts API', function () {
|
|||
model.get('updated_at').toISOString().should.not.eql(post.updated_at);
|
||||
});
|
||||
});
|
||||
|
||||
it('Can change scheduled post', function () {
|
||||
return request
|
||||
.get(localUtils.API.getApiQuery(`posts/${testUtils.DataGenerator.Content.posts[7].id}/`))
|
||||
.set('Origin', config.get('url'))
|
||||
.expect(200)
|
||||
.then((res) => {
|
||||
res.body.posts[0].status.should.eql('scheduled');
|
||||
|
||||
return request
|
||||
.put(localUtils.API.getApiQuery('posts/' + testUtils.DataGenerator.Content.posts[7].id + '/'))
|
||||
.set('Origin', config.get('url'))
|
||||
.send({
|
||||
posts: [{
|
||||
title: 'change scheduled post',
|
||||
updated_at: res.body.posts[0].updated_at
|
||||
}]
|
||||
})
|
||||
.expect('Content-Type', /json/)
|
||||
.expect('Cache-Control', testUtils.cacheRules.private)
|
||||
.expect(200);
|
||||
})
|
||||
.then((res) => {
|
||||
should.exist(res.headers['x-cache-invalidate']);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('destroy', function () {
|
||||
|
|
Loading…
Reference in a new issue