Commit 14d46dcb681366d46fc156312ea9138e8ff88bbb

Authored by JoenioCosta
1 parent cee67307

ActionItem280: add Friends block to person and fix some tests

git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1744 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/models/person.rb
@@ -93,6 +93,7 @@ class Person < Profile @@ -93,6 +93,7 @@ class Person < Profile
93 93
94 # right area 94 # right area
95 self.boxes[2].blocks << TagsBlock.new 95 self.boxes[2].blocks << TagsBlock.new
  96 + self.boxes[2].blocks << FriendsBlock.new
96 self.boxes[2].blocks << CommunitiesBlock.new 97 self.boxes[2].blocks << CommunitiesBlock.new
97 self.boxes[2].blocks << EnterprisesBlock.new 98 self.boxes[2].blocks << EnterprisesBlock.new
98 99
test/functional/search_controller_test.rb
@@ -451,7 +451,7 @@ class SearchControllerTest &lt; Test::Unit::TestCase @@ -451,7 +451,7 @@ class SearchControllerTest &lt; Test::Unit::TestCase
451 CategoryFinder.expects(:new).with(@category).returns(finger) 451 CategoryFinder.expects(:new).with(@category).returns(finger)
452 452
453 get :category_index, :category_path => [ 'my-category' ] 453 get :category_index, :category_path => [ 'my-category' ]
454 - assert_same recent, assigns(:results)[:recent_comments] 454 + assert_same recent, assigns(:results)[:comments]
455 end 455 end
456 456
457 should 'list most commented articles in the category' do 457 should 'list most commented articles in the category' do
test/unit/person_test.rb
@@ -138,9 +138,9 @@ class PersonTest &lt; Test::Unit::TestCase @@ -138,9 +138,9 @@ class PersonTest &lt; Test::Unit::TestCase
138 assert p.boxes[2].blocks.map(&:class).include?(TagsBlock), 'person must have a Tags Block upon creation' 138 assert p.boxes[2].blocks.map(&:class).include?(TagsBlock), 'person must have a Tags Block upon creation'
139 assert p.boxes[2].blocks.map(&:class).include?(CommunitiesBlock), 'person must have a CommunitiesBlock upon creation' 139 assert p.boxes[2].blocks.map(&:class).include?(CommunitiesBlock), 'person must have a CommunitiesBlock upon creation'
140 assert p.boxes[2].blocks.map(&:class).include?(EnterprisesBlock), 'person must have a EnterprisesBlock upon creation' 140 assert p.boxes[2].blocks.map(&:class).include?(EnterprisesBlock), 'person must have a EnterprisesBlock upon creation'
141 - # TODO check also for a "friends" block 141 + assert p.boxes[2].blocks.map(&:class).include?(FriendsBlock), 'person must have a FriendsBlock upon creation'
142 142
143 - assert_equal 6, p.blocks.size 143 + assert_equal 7, p.blocks.size
144 end 144 end
145 145
146 should 'have friends' do 146 should 'have friends' do