From 4a8583d3308b6ad4f00999f006fde83fd6a76f30 Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Wed, 22 Jul 2009 18:49:34 -0300 Subject: [PATCH] ActionItem1125: display only to people --- app/views/profile_editor/index.rhtml | 2 +- test/functional/profile_editor_controller_test.rb | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/views/profile_editor/index.rhtml b/app/views/profile_editor/index.rhtml index e6814d5..575ef51 100644 --- a/app/views/profile_editor/index.rhtml +++ b/app/views/profile_editor/index.rhtml @@ -62,7 +62,7 @@ <%= control_panel_button(_('Manage my groups'), 'groups', :controller => 'memberships') if profile.person? %> <% end %> - <% if environment.enabled?('enterprise_activation') %> + <% if profile.person? && environment.enabled?('enterprise_activation') %>
<% form_tag({:controller => 'account', :action => 'activation_question'}, {:method => 'get'}) do %> diff --git a/test/functional/profile_editor_controller_test.rb b/test/functional/profile_editor_controller_test.rb index 806d1de..ba90fb3 100644 --- a/test/functional/profile_editor_controller_test.rb +++ b/test/functional/profile_editor_controller_test.rb @@ -712,5 +712,17 @@ class ProfileEditorControllerTest < Test::Unit::TestCase assert_tag :tag => 'div', :attributes => { :id => 'activation_enterprise' }, :descendant => {:tag => 'form', :attributes => {:action => '/account/activation_question'}} end + should 'not display enterprise activation to enterprises' do + env = Environment.default + env.enable('enterprise_activation') + env.save! + + enterprise = Enterprise.create!(:name => 'bli', :identifier => 'bli') + enterprise.add_admin(profile) + + get :index, :profile => enterprise.identifier + assert_no_tag :tag => 'div', :attributes => { :id => 'activation_enterprise' }, :descendant => {:tag => 'form', :attributes => {:action => '/account/activation_question'}} + end + end -- libgit2 0.21.2