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

Ensure editor awareness if publishing fails

closes #3667
- If the ‘save’ function on a new post fails, the local Ember model
still beliefs that the status is ‘published’, resulting in wrong
buttons. A simple catch fixes that.
This commit is contained in:
Felix Rieseberg 2014-08-13 13:38:45 -07:00
parent b6507bed9b
commit 6e8c98e27c
2 changed files with 9 additions and 0 deletions

View file

@ -11,6 +11,9 @@ var EditorNewController = Ember.ObjectController.extend(EditorControllerMixin, {
if (model.get('id')) { if (model.get('id')) {
self.transitionToRoute('editor.edit', model); self.transitionToRoute('editor.edit', model);
} }
}).catch(function () {
// Publishing failed
self.set('status', 'draft');
}); });
} }
} }

View file

@ -421,6 +421,12 @@ CasperTest.begin('Publish menu - new post', 11, function suite(test) {
test.assertSelectorHasText('.js-publish-button', 'Save Draft'); test.assertSelectorHasText('.js-publish-button', 'Save Draft');
}); });
// Fill headline and content
casper.then(function fillContent() {
casper.sendKeys('#entry-title', 'Headline');
casper.writeContentToCodeMirror('Just a bit of testtext');
})
casper.then(function switchMenuToPublish() { casper.then(function switchMenuToPublish() {
// Open the publish options menu; // Open the publish options menu;
casper.thenClick('.js-publish-splitbutton .options.up'); casper.thenClick('.js-publish-splitbutton .options.up');