Commit 782b123f298ab5259b70e2e512cdb2c29aa9d1b6
Committed by
Gabriela Navarro
1 parent
22243571
Exists in
master
and in
29 other branches
Fix header/footer disable feature visualization logic
(ActionItem3251) Signed-off-by: Arthur Del Esposte <arthurmde@gmail.com> Signed-off-by: David Carlos <ddavidcarlos1392@gmail.com> Signed-off-by: Gabriela Navarro <navarro1703@gmail.com>
Showing
2 changed files
with
22 additions
and
1 deletions
Show diff stats
app/views/profile_editor/index.html.erb
... | ... | @@ -24,7 +24,7 @@ |
24 | 24 | |
25 | 25 | <%= control_panel_button(_('Edit Appearance'), 'design-editor', :controller => 'profile_themes', :action => 'index') %> |
26 | 26 | |
27 | - <%= 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) %> | |
27 | + <%= 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')) %> | |
28 | 28 | |
29 | 29 | <%= control_panel_button(_('Manage Content'), 'cms', :controller => 'cms') %> |
30 | 30 | ... | ... |
test/functional/profile_editor_controller_test.rb
... | ... | @@ -1070,4 +1070,25 @@ class ProfileEditorControllerTest < ActionController::TestCase |
1070 | 1070 | :descendant => {:tag => 'input', :attributes => {:id => 'profile_data_products_per_catalog_page'} } |
1071 | 1071 | end |
1072 | 1072 | |
1073 | + should 'show head and footer for admin' do | |
1074 | + login_as('default_user') | |
1075 | + get :index, :profile => profile.identifier | |
1076 | + assert_tag :tag => 'div', :descendant => { :tag => 'a', :content => 'Edit Header and Footer' } | |
1077 | + end | |
1078 | + | |
1079 | + should 'not display header and footer for user when feature is enable' do | |
1080 | + user = create_user('user').person | |
1081 | + login_as('user') | |
1082 | + profile.environment.enable('disable_header_and_footer') | |
1083 | + get :index, :profile => user.identifier | |
1084 | + assert_no_tag :tag => 'div', :descendant => { :tag => 'a', :content => 'Edit Header and Footer' } | |
1085 | + end | |
1086 | + | |
1087 | + should 'display header and footer for user when feature is disabled ' do | |
1088 | + user = create_user('user').person | |
1089 | + login_as('user') | |
1090 | + profile.environment.disable('disable_header_and_footer') | |
1091 | + get :index, :profile => user.identifier | |
1092 | + assert_tag :tag => 'div', :descendant => { :tag => 'a', :content => 'Edit Header and Footer' } | |
1093 | + end | |
1073 | 1094 | end | ... | ... |