diff --git a/app/views/profile_editor/index.html.erb b/app/views/profile_editor/index.html.erb index 0e9ba73..3054f69 100644 --- a/app/views/profile_editor/index.html.erb +++ b/app/views/profile_editor/index.html.erb @@ -24,7 +24,7 @@ <%= control_panel_button(_('Edit Appearance'), 'design-editor', :controller => 'profile_themes', :action => 'index') %> - <%= control_panel_button(_('Edit Header and Footer'), 'header-and-footer', :controller => 'profile_editor', :action => 'header_footer') unless profile.enterprise? && environment.enabled?('disable_header_and_footer') && !user.is_admin?(environment) %> + <%= control_panel_button(_('Edit Header and Footer'), 'header-and-footer', :controller => 'profile_editor', :action => 'header_footer') if user.is_admin?(environment) || (!profile.enterprise? && !environment.enabled?('disable_header_and_footer')) %> <%= control_panel_button(_('Manage Content'), 'cms', :controller => 'cms') %> diff --git a/test/functional/profile_editor_controller_test.rb b/test/functional/profile_editor_controller_test.rb index 854dcea..9ac5aab 100644 --- a/test/functional/profile_editor_controller_test.rb +++ b/test/functional/profile_editor_controller_test.rb @@ -1070,4 +1070,25 @@ class ProfileEditorControllerTest < ActionController::TestCase :descendant => {:tag => 'input', :attributes => {:id => 'profile_data_products_per_catalog_page'} } end + should 'show head and footer for admin' do + login_as('default_user') + get :index, :profile => profile.identifier + assert_tag :tag => 'div', :descendant => { :tag => 'a', :content => 'Edit Header and Footer' } + end + + should 'not display header and footer for user when feature is enable' do + user = create_user('user').person + login_as('user') + profile.environment.enable('disable_header_and_footer') + get :index, :profile => user.identifier + assert_no_tag :tag => 'div', :descendant => { :tag => 'a', :content => 'Edit Header and Footer' } + end + + should 'display header and footer for user when feature is disabled ' do + user = create_user('user').person + login_as('user') + profile.environment.disable('disable_header_and_footer') + get :index, :profile => user.identifier + assert_tag :tag => 'div', :descendant => { :tag => 'a', :content => 'Edit Header and Footer' } + end end -- libgit2 0.21.2