Commit 63861f760cec39df4e08fb1db6d2d44fff7e99b4
1 parent
1e27bb80
Exists in
master
and in
29 other branches
ActionItem629: Debian etch porting
Person#communities returns a plain Array, not an ActiveRecord-decorated one git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@2378 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
2 additions
and
2 deletions
Show diff stats
app/models/my_network_block.rb
@@ -16,7 +16,7 @@ class MyNetworkBlock < Block | @@ -16,7 +16,7 @@ class MyNetworkBlock < Block | ||
16 | 'ul', | 16 | 'ul', |
17 | content_tag('li', link_to(n_( 'One article published', '%d articles published', owner.articles.count) % owner.articles.count, owner.public_profile_url.merge(:action => 'sitemap') )) + | 17 | content_tag('li', link_to(n_( 'One article published', '%d articles published', owner.articles.count) % owner.articles.count, owner.public_profile_url.merge(:action => 'sitemap') )) + |
18 | content_tag('li', link_to(n__('One friend', '%d friends', owner.friends.count) % owner.friends.count, owner.public_profile_url.merge(:action => 'friends'))) + | 18 | content_tag('li', link_to(n__('One friend', '%d friends', owner.friends.count) % owner.friends.count, owner.public_profile_url.merge(:action => 'friends'))) + |
19 | - content_tag('li', link_to(n__('One community', '%d communities', owner.communities.count) % owner.communities.count, owner.public_profile_url.merge(:action => 'communities'))) + | 19 | + content_tag('li', link_to(n__('One community', '%d communities', owner.communities.size) % owner.communities.size, owner.public_profile_url.merge(:action => 'communities'))) + |
20 | content_tag('li', link_to(n_('One tag', '%d tags', owner.tags.size) % owner.tags.size, owner.public_profile_url.merge(:action => 'tags'))) | 20 | content_tag('li', link_to(n_('One tag', '%d tags', owner.tags.size) % owner.tags.size, owner.public_profile_url.merge(:action => 'tags'))) |
21 | ) | 21 | ) |
22 | end | 22 | end |
test/unit/my_network_block_test.rb
@@ -39,7 +39,7 @@ class MyNetworkBlockTest < ActiveSupport::TestCase | @@ -39,7 +39,7 @@ class MyNetworkBlockTest < ActiveSupport::TestCase | ||
39 | should 'count communities' do | 39 | should 'count communities' do |
40 | mock_communities = mock | 40 | mock_communities = mock |
41 | owner.stubs(:communities).returns(mock_communities) | 41 | owner.stubs(:communities).returns(mock_communities) |
42 | - mock_communities.stubs(:count).returns(23) | 42 | + mock_communities.stubs(:size).returns(23) |
43 | 43 | ||
44 | assert_tag_in_string block.content, :tag => 'li', :descendant => { :tag => 'a', :content => '23 communities', :attributes => { :href => /\profile\/testuser\/communities/ }} | 44 | assert_tag_in_string block.content, :tag => 'li', :descendant => { :tag => 'a', :content => '23 communities', :attributes => { :href => /\profile\/testuser\/communities/ }} |
45 | end | 45 | end |