diff --git a/app/views/home/welcome.html.erb b/app/views/home/welcome.html.erb index d99dd44..83aba24 100644 --- a/app/views/home/welcome.html.erb +++ b/app/views/home/welcome.html.erb @@ -17,8 +17,11 @@

<%= _("You won't appear as %s until your account is approved.") % link_to(_('user'), {:controller => :search, :action => :people, :filter => 'more_recent'}, :target => '_blank') %>

<% end %>

<%= _("What to do next?") %>

-

<%= _("Access your %s and see your face on the network!") % link_to(_('Profile'), {:controller => 'profile', :profile => user.identifier}, :target => '_blank') %>

-

<%= _("Explore your %s to customize your profile. Here are some %s on what you can do there.") % [link_to(_('Control Panel'), {:controller => 'profile_editor', :profile => user.identifier}, :target => '_blank'), link_to(_('tips'), {:controller => 'doc', :action => 'topic', :section => 'user', :topic => 'editing-person-info'}, :target => '_blank')] %>

+

<%= _("Access your %s and see your face on the network!") % + (user.present? ? link_to(_('Profile'), {:controller => 'profile', :profile => user.identifier}, :target => '_blank') : 'Profile') %> + <%= _("You can also explore your %s to customize your profile. Here are some %s on what you can do there.") % + [user.present? ? link_to(_('Control Panel'), {:controller => 'profile_editor', :profile => user.identifier}, :target => '_blank') : 'Control Panel', + link_to(_('tips'), {:controller => 'doc', :action => 'topic', :section => 'user', :topic => 'editing-person-info'}, :target => '_blank')] %>

<%= _("%s your Gmail, Yahoo and Hotmail contacts!") % link_to(_('Invite and find'), {:controller => 'doc', :action => 'topic', :section => 'user', :topic => 'invite-contacts'}, :target => '_blank') %>

<%= _("Learn the guidelines. Read the %s for more details on how to use this social network!") % link_to(_('Documentation'), {:controller => 'doc'}, :target => '_blank') %>

<%= _("Start exploring and have fun!") %>

diff --git a/test/functional/enterprise_registration_controller_test.rb b/test/functional/enterprise_registration_controller_test.rb index 765529c..33e746c 100644 --- a/test/functional/enterprise_registration_controller_test.rb +++ b/test/functional/enterprise_registration_controller_test.rb @@ -66,7 +66,7 @@ class EnterpriseRegistrationControllerTest < ActionController::TestCase template.welcome_page = welcome_page template.save! - data = { :name => 'My new enterprise', :identifier => 'mynew', :region => region, :template_id => template.id } + data = { :name => 'My new enterprise', :identifier => 'mynew', :region_id => region.id, :template_id => template.id } create_enterprise = CreateEnterprise.new(data) post :index, :create_enterprise => data diff --git a/test/functional/profile_editor_controller_test.rb b/test/functional/profile_editor_controller_test.rb index 8a82f71..4490fa0 100644 --- a/test/functional/profile_editor_controller_test.rb +++ b/test/functional/profile_editor_controller_test.rb @@ -880,14 +880,14 @@ class ProfileEditorControllerTest < ActionController::TestCase end end - should 'have welcome_page only for person template' do + should 'have welcome_page only for template' do organization = fast_create(Organization, :is_template => false) @controller.stubs(:profile).returns(organization) assert !@controller.send(:has_welcome_page) organization = fast_create(Organization, :is_template => true) @controller.stubs(:profile).returns(organization) - assert !@controller.send(:has_welcome_page) + assert @controller.send(:has_welcome_page) person = fast_create(Person, :is_template => false) @controller.stubs(:profile).returns(person) @@ -901,11 +901,11 @@ class ProfileEditorControllerTest < ActionController::TestCase should 'display welcome_page button only if profile has_welcome_page' do @controller.stubs(:has_welcome_page).returns(true) get :index, :profile => fast_create(Profile).identifier - assert_tag :tag => 'a', :content => 'Edit Welcome Page' + assert_tag :tag => 'a', :content => 'Edit welcome page' @controller.stubs(:has_welcome_page).returns(false) get :index, :profile => fast_create(Profile).identifier - assert_no_tag :tag => 'a', :content => 'Edit Welcome Page' + assert_no_tag :tag => 'a', :content => 'Edit welcome page' end should 'not be able to access welcome_page if profile does not has_welcome_page' do @@ -920,11 +920,14 @@ class ProfileEditorControllerTest < ActionController::TestCase 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 person_template.is_template = true + + welcome_page = fast_create(TinyMceArticle, :body => 'Initial welcome page') person_template.welcome_page = welcome_page person_template.save! + welcome_page.profile = person_template + welcome_page.save! new_content = 'New welcome page' post :welcome_page, :profile => person_template.identifier, :welcome_page => {:body => new_content} -- libgit2 0.21.2