diff --git a/app/models/profile_list_block.rb b/app/models/profile_list_block.rb index 9203ae6..af35a2a 100644 --- a/app/models/profile_list_block.rb +++ b/app/models/profile_list_block.rb @@ -37,10 +37,16 @@ class ProfileListBlock < Block Kernel.rand(top) end + # the title of the block. Probably will be overriden in subclasses. + def title + _('People and Groups') + end + def content profiles = self.profiles + title = self.title lambda do - block_title(_('People and Groups')) + + block_title(title) + profiles.map {|item| content_tag('div', profile_image_link(item)) }.join("\n") end end diff --git a/test/unit/profile_list_block_test.rb b/test/unit/profile_list_block_test.rb index 1de1d52..16fb381 100644 --- a/test/unit/profile_list_block_test.rb +++ b/test/unit/profile_list_block_test.rb @@ -34,7 +34,6 @@ class ProfileListBlockTest < Test::Unit::TestCase self.expects(:profile_image_link).with(person3).once self.expects(:content_tag).returns('
').at_least_once - self.expects(:_).returns('text').at_least_once self.expects(:block_title).returns('block title').at_least_once assert_kind_of String, instance_eval(&block.content) @@ -53,9 +52,9 @@ class ProfileListBlockTest < Test::Unit::TestCase should 'support non-class finders' do block = ProfileListBlock.new - profile = create_user('mytestuser').person - block.expects(:profile_finder).returns(profile.members).once - profile.members.expects(:find).with(is_a(Hash)).once + finder = mock + block.expects(:profile_finder).returns(finder).once + finder.expects(:find).with(is_a(Hash)).once block.profiles end -- libgit2 0.21.2