From b5fbc8bbb86cb43ce2e6b4b178ec9508dcee8da0 Mon Sep 17 00:00:00 2001 From: Moises Machado Date: Thu, 23 Jul 2009 19:34:41 -0300 Subject: [PATCH] ActionItem1160: nickname cant be optional for communities --- app/models/community.rb | 1 - app/views/shared/_custom_fields.rhtml | 1 - test/functional/profile_editor_controller_test.rb | 13 ------------- 3 files changed, 0 insertions(+), 15 deletions(-) diff --git a/app/models/community.rb b/app/models/community.rb index 5793f5b..dc8949a 100644 --- a/app/models/community.rb +++ b/app/models/community.rb @@ -9,7 +9,6 @@ class Community < Organization FIELDS = %w[ description - nickname language ] diff --git a/app/views/shared/_custom_fields.rhtml b/app/views/shared/_custom_fields.rhtml index afe46d7..7def9c8 100644 --- a/app/views/shared/_custom_fields.rhtml +++ b/app/views/shared/_custom_fields.rhtml @@ -1,5 +1,4 @@ <% if profile.community? %> - <%= optional_field(profile, 'nickname', labelled_form_field(_('Display name'), text_field(object_name, :nickname) + ' ' + content_tag('em', _('A short name by which the organization is know.'))), only_required) %> <%= optional_field(profile, 'description', f.text_area(:description, :rows => 5)) %> <%= optional_field(profile, 'language', f.text_field(:language), only_required) %> <% end %> diff --git a/test/functional/profile_editor_controller_test.rb b/test/functional/profile_editor_controller_test.rb index 06179f7..22e18cf 100644 --- a/test/functional/profile_editor_controller_test.rb +++ b/test/functional/profile_editor_controller_test.rb @@ -797,17 +797,4 @@ class ProfileEditorControllerTest < Test::Unit::TestCase end end - should 'display nickname field only if active when edit community' do - community = Community.create(:name => 'test_profile') - Environment.any_instance.stubs(:required_community_fields).returns([]) - - Environment.any_instance.stubs(:active_community_fields).returns(['description']) - get :edit, :profile => community.identifier - assert_no_tag :tag => 'input', :attributes => { :name => "profile_data[nickname]" } - - Environment.any_instance.stubs(:active_community_fields).returns(['nickname']) - get :edit, :profile => community.identifier - assert_tag :tag => 'input', :attributes => { :name => "profile_data[nickname]" } - end - end -- libgit2 0.21.2