diff --git a/app/controllers/my_profile/cms_controller.rb b/app/controllers/my_profile/cms_controller.rb index adc794c..f997730 100644 --- a/app/controllers/my_profile/cms_controller.rb +++ b/app/controllers/my_profile/cms_controller.rb @@ -139,9 +139,15 @@ class CmsController < MyProfileController @article.profile = profile @article.last_changed_by = user + + continue = params[:continue] if request.post? if @article.save - redirect_to @article.view_url + if continue + redirect_to :action => 'edit', :id => @article + else + redirect_to @article.view_url + end return end end diff --git a/features/edit_article.feature b/features/edit_article.feature index 07e5ec1..4528d98 100644 --- a/features/edit_article.feature +++ b/features/edit_article.feature @@ -122,3 +122,14 @@ Feature: edit article Then show me the page Then the "Text" field should contain "new text" And I should be on "Save the whales" edit page + + Scenario: save and continue when creating a new article + Given I am on /joaosilva + When I follow "New article" + And I follow "Text article with visual editor" + And I fill in "Title" with "My new article" + And I fill in "Text" with "text for the new article" + And I press "Save and continue" + Then I should be on "My new article" edit page + And the "Title" field should contain "My new article" + And the "Text" field should contain "text for the new article" -- libgit2 0.21.2