Commit c211161f34ed0852c2b8e642e37eefa0d92725da
1 parent
d380dc08
Exists in
master
and in
28 other branches
ActionItem320: pointing to all people
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1712 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
15 additions
and
0 deletions
Show diff stats
app/models/people_block.rb
| @@ -22,4 +22,10 @@ class PeopleBlock < ProfileListBlock | @@ -22,4 +22,10 @@ class PeopleBlock < ProfileListBlock | ||
| 22 | end | 22 | end |
| 23 | end | 23 | end |
| 24 | 24 | ||
| 25 | + def footer | ||
| 26 | + lambda do | ||
| 27 | + link_to _('All people'), :controller => 'search', :action => 'assets', :asset => 'people' | ||
| 28 | + end | ||
| 29 | + end | ||
| 30 | + | ||
| 25 | end | 31 | end |
test/unit/people_block_test.rb
| @@ -32,4 +32,13 @@ class PeopleBlockTest < ActiveSupport::TestCase | @@ -32,4 +32,13 @@ class PeopleBlockTest < ActiveSupport::TestCase | ||
| 32 | block.content | 32 | block.content |
| 33 | end | 33 | end |
| 34 | 34 | ||
| 35 | + should 'link to people directory' do | ||
| 36 | + block = PeopleBlock.new | ||
| 37 | + block.stubs(:owner).returns(Environment.default) | ||
| 38 | + | ||
| 39 | + expects(:link_to).with('All people', :controller => 'search', :action => 'assets', :asset => 'people') | ||
| 40 | + expects(:_).with('All people').returns('All people') | ||
| 41 | + instance_eval(&block.footer) | ||
| 42 | + end | ||
| 43 | + | ||
| 35 | end | 44 | end |