diff --git a/app/views/memberships/index.rhtml b/app/views/memberships/index.rhtml index 74584f1..5fae171 100644 --- a/app/views/memberships/index.rhtml +++ b/app/views/memberships/index.rhtml @@ -4,23 +4,17 @@ <%= _('%s is a member of the following groups:') % profile.name %>

- - - - - - - - <% for membership in @memberships %> - - - - + <% end %> diff --git a/test/functional/memberships_controller_test.rb b/test/functional/memberships_controller_test.rb index 8dff14f..0084ad6 100644 --- a/test/functional/memberships_controller_test.rb +++ b/test/functional/memberships_controller_test.rb @@ -89,17 +89,28 @@ class MembershipsControllerTest < Test::Unit::TestCase community = Community.create!(:name => 'my test community') community.add_member(profile) get :index, :profile => profile.identifier - assert_tag :tag => 'th', :content => 'Members' - assert_tag :tag => 'td', :content => '1' + assert_tag :tag => 'td', :content => /Members: 1/ end should 'show created at on list' do community = Community.create!(:name => 'my test community') community.add_member(profile) - created = show_date(community.created_at) get :index, :profile => profile.identifier - assert_tag :tag => 'th', :content => 'Created at' - assert_tag :tag => 'td', :content => created + assert_tag :tag => 'td', :content => /Created at: #{show_date(community.created_at)}/ + end + + should 'show description on list' do + community = Community.create!(:name => 'my test community', :description => 'description test') + community.add_member(profile) + get :index, :profile => profile.identifier + assert_tag :tag => 'td', :content => /Description: description test/ + end + + should 'not show description to enterprises on list' do + enterprise = Enterprise.create!(:identifier => 'enterprise-test', :name => 'my test enterprise') + enterprise.add_member(profile) + get :index, :profile => profile.identifier + assert_no_tag :tag => 'td', :content => /Description:/ end end -- libgit2 0.21.2
<%= _('Name') %><%= _('Type') %><%= _('Members') %><%= _('Created at') %><%= _('Actions') %>
<%= link_to membership.name, membership.url %><%= _(membership.class.name) %><%= membership.members.size.to_s %><%= show_date(membership.created_at) %> <%= image_tag(profile_icon(membership)) %> - <%= link_to _('Manage'), membership.admin_url %> + <%= _('Name: %s:') % link_to(membership.name, membership.url) %>
+ <%= _('Type: %s') % _(membership.class.name) %>
+ <%= _('Description: %s') % membership.description + '
' if membership.kind_of?(Community) %> + <%= _('Members: %s') % membership.members.size.to_s %>
+ <%= _('Created at: %s') % show_date(membership.created_at) %>
+ <%= _('Actions: %s') % link_to(_('Manage'), membership.admin_url) %>