Commit b5fbc8bbb86cb43ce2e6b4b178ec9508dcee8da0

Authored by Moises Machado
Committed by Antonio Terceiro
1 parent 2b7a67f9

ActionItem1160: nickname cant be optional for communities

* this is because of the identifier thats derived from the nickname becouse of ActionItem1126
app/models/community.rb
@@ -9,7 +9,6 @@ class Community < Organization @@ -9,7 +9,6 @@ class Community < Organization
9 9
10 FIELDS = %w[ 10 FIELDS = %w[
11 description 11 description
12 - nickname  
13 language 12 language
14 ] 13 ]
15 14
app/views/shared/_custom_fields.rhtml
1 <% if profile.community? %> 1 <% if profile.community? %>
2 - <%= optional_field(profile, 'nickname', labelled_form_field(_('Display name'), text_field(object_name, :nickname) + '&nbsp;' + content_tag('em', _('A short name by which the organization is know.'))), only_required) %>  
3 <%= optional_field(profile, 'description', f.text_area(:description, :rows => 5)) %> 2 <%= optional_field(profile, 'description', f.text_area(:description, :rows => 5)) %>
4 <%= optional_field(profile, 'language', f.text_field(:language), only_required) %> 3 <%= optional_field(profile, 'language', f.text_field(:language), only_required) %>
5 <% end %> 4 <% end %>
test/functional/profile_editor_controller_test.rb
@@ -797,17 +797,4 @@ class ProfileEditorControllerTest &lt; Test::Unit::TestCase @@ -797,17 +797,4 @@ class ProfileEditorControllerTest &lt; Test::Unit::TestCase
797 end 797 end
798 end 798 end
799 799
800 - should 'display nickname field only if active when edit community' do  
801 - community = Community.create(:name => 'test_profile')  
802 - Environment.any_instance.stubs(:required_community_fields).returns([])  
803 -  
804 - Environment.any_instance.stubs(:active_community_fields).returns(['description'])  
805 - get :edit, :profile => community.identifier  
806 - assert_no_tag :tag => 'input', :attributes => { :name => "profile_data[nickname]" }  
807 -  
808 - Environment.any_instance.stubs(:active_community_fields).returns(['nickname'])  
809 - get :edit, :profile => community.identifier  
810 - assert_tag :tag => 'input', :attributes => { :name => "profile_data[nickname]" }  
811 - end  
812 -  
813 end 800 end