Commit 3d48702e65df8eff4c292c79fe10910ff00b5165
1 parent
21897056
Exists in
master
and in
28 other branches
ActionItem167: tested and added members listing
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1508 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
4 changed files
with
37 additions
and
3 deletions
Show diff stats
app/controllers/public/profile_controller.rb
app/views/profile/index.rhtml
@@ -14,6 +14,9 @@ | @@ -14,6 +14,9 @@ | ||
14 | <li><%= link_to_function _('Friends'), 'alert(%s)' % _('This function is not available yet.').inspect %></li> | 14 | <li><%= link_to_function _('Friends'), 'alert(%s)' % _('This function is not available yet.').inspect %></li> |
15 | <li><%= link_to _('Communities'), :action => 'communities' %></li> | 15 | <li><%= link_to _('Communities'), :action => 'communities' %></li> |
16 | <li><%= link_to _('Enterprises'), :action => 'enterprises' %></li> | 16 | <li><%= link_to _('Enterprises'), :action => 'enterprises' %></li> |
17 | + <% if profile.kind_of? Organization %> | ||
18 | + <li><%= link_to _('Members'), :action => 'members' %></li> | ||
19 | + <% end %> | ||
17 | 20 | ||
18 | <li> | 21 | <li> |
19 | <%= _('Tags:') %> | 22 | <%= _('Tags:') %> |
@@ -0,0 +1,11 @@ | @@ -0,0 +1,11 @@ | ||
1 | +<h1><%= _("%s' members") % profile.name %></h1> | ||
2 | + | ||
3 | +<ul class='profile-list'> | ||
4 | + <% @members.each do |member| %> | ||
5 | + <li><%= profile_image_link(member) %></li> | ||
6 | + <% end %> | ||
7 | +</ul> | ||
8 | + | ||
9 | +<% button_bar do %> | ||
10 | + <%= button(:back, _('Go back'), :controller => 'profile') %> | ||
11 | +<% end %> |
test/functional/profile_controller_test.rb
@@ -23,10 +23,27 @@ class ProfileControllerTest < Test::Unit::TestCase | @@ -23,10 +23,27 @@ class ProfileControllerTest < Test::Unit::TestCase | ||
23 | assert_kind_of Array, assigns(:friends) | 23 | assert_kind_of Array, assigns(:friends) |
24 | end | 24 | end |
25 | 25 | ||
26 | - should 'list communities' | 26 | + should 'list communities' do |
27 | + get :communities | ||
27 | 28 | ||
28 | - should 'list environments' | 29 | + assert_response :success |
30 | + assert_template 'communities' | ||
31 | + assert_kind_of Array, assigns(:communities) | ||
32 | + end | ||
33 | + | ||
34 | + should 'list enterprises' do | ||
35 | + get :enterprises | ||
36 | + | ||
37 | + assert_response :success | ||
38 | + assert_template 'enterprises' | ||
39 | + assert_kind_of Array, assigns(:enterprises) | ||
40 | + end | ||
29 | 41 | ||
30 | - should 'list members (for organizations)' | 42 | + should 'list members (for organizations)' do |
43 | + get :members | ||
31 | 44 | ||
45 | + assert_response :success | ||
46 | + assert_template 'members' | ||
47 | + assert_kind_of Array, assigns(:members) | ||
48 | + end | ||
32 | end | 49 | end |