Commit 3776461b30ab976f4009fe388f2ca6c179ad1d1b

Authored by Rodrigo Souto
1 parent bde757c9

[template-welcome-page] Define welcome_page with published false by default

(ActionItem3075)
app/controllers/my_profile/profile_editor_controller.rb
... ... @@ -83,7 +83,7 @@ class ProfileEditorController < MyProfileController
83 83 end
84 84  
85 85 def welcome_page
86   - @welcome_page = profile.welcome_page || TinyMceArticle.new(:name => 'Welcome Page', :profile => profile)
  86 + @welcome_page = profile.welcome_page || TinyMceArticle.new(:name => 'Welcome Page', :profile => profile, :published => false)
87 87 if request.post?
88 88 begin
89 89 @welcome_page.update_attributes!(params[:welcome_page])
... ...
test/functional/profile_editor_controller_test.rb
... ... @@ -910,6 +910,11 @@ class ProfileEditorControllerTest < ActionController::TestCase
910 910 assert_response :forbidden
911 911 end
912 912  
  913 + should 'create welcome_page with public false by default' do
  914 + get :welcome_page, :profile => fast_create(Person, :is_template => true).identifier
  915 + assert !assigns(:welcome_page).published
  916 + end
  917 +
913 918 should 'update welcome page and redirect to index' do
914 919 welcome_page = fast_create(TinyMceArticle, :body => 'Initial welcome page')
915 920 person_template = create_user('person_template').person
... ...