diff --git a/app/controllers/my_profile/profile_editor_controller.rb b/app/controllers/my_profile/profile_editor_controller.rb index 0387b4f..b03482a 100644 --- a/app/controllers/my_profile/profile_editor_controller.rb +++ b/app/controllers/my_profile/profile_editor_controller.rb @@ -83,7 +83,7 @@ class ProfileEditorController < MyProfileController end def welcome_page - @welcome_page = profile.welcome_page || TinyMceArticle.new(:name => 'Welcome Page', :profile => profile) + @welcome_page = profile.welcome_page || TinyMceArticle.new(:name => 'Welcome Page', :profile => profile, :published => false) if request.post? begin @welcome_page.update_attributes!(params[:welcome_page]) diff --git a/test/functional/profile_editor_controller_test.rb b/test/functional/profile_editor_controller_test.rb index 7488477..dfe2943 100644 --- a/test/functional/profile_editor_controller_test.rb +++ b/test/functional/profile_editor_controller_test.rb @@ -910,6 +910,11 @@ class ProfileEditorControllerTest < ActionController::TestCase assert_response :forbidden end + should 'create welcome_page with public false by default' do + get :welcome_page, :profile => fast_create(Person, :is_template => true).identifier + assert !assigns(:welcome_page).published + end + should 'update welcome page and redirect to index' do welcome_page = fast_create(TinyMceArticle, :body => 'Initial welcome page') person_template = create_user('person_template').person -- libgit2 0.21.2