Commit fdeb05ebc8bb9ef4a2dd30490152dbb5ed953987

Authored by AntonioTerceiro
1 parent 9b43a97d

ActionItem18: creating a proper list on RecentDocumentsBlock



git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@433 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/models/recent_documents_block.rb
@@ -4,7 +4,7 @@ class RecentDocumentsBlock < Design::Block @@ -4,7 +4,7 @@ class RecentDocumentsBlock < Design::Block
4 lambda do 4 lambda do
5 content_tag( 5 content_tag(
6 'ul', 6 'ul',
7 - profile.recent_documents.map {|item| link_to_document(item) }.join("\n") 7 + profile.recent_documents.map {|item| content_tag('li', link_to_document(item)) }.join("\n")
8 ) 8 )
9 end 9 end
10 end 10 end
test/unit/recent_documents_block_test.rb
@@ -15,8 +15,11 @@ class RecentDocumentsBlockTest < Test::Unit::TestCase @@ -15,8 +15,11 @@ class RecentDocumentsBlockTest < Test::Unit::TestCase
15 helper = mock 15 helper = mock
16 helper.expects(:profile).returns(profile) 16 helper.expects(:profile).returns(profile)
17 helper.expects(:link_to_document).with(doc1).returns('doc1') 17 helper.expects(:link_to_document).with(doc1).returns('doc1')
  18 + helper.expects(:content_tag).with('li', 'doc1').returns('doc1')
18 helper.expects(:link_to_document).with(doc2).returns('doc2') 19 helper.expects(:link_to_document).with(doc2).returns('doc2')
  20 + helper.expects(:content_tag).with('li', 'doc2').returns('doc2')
19 helper.expects(:link_to_document).with(doc3).returns('doc3') 21 helper.expects(:link_to_document).with(doc3).returns('doc3')
  22 + helper.expects(:content_tag).with('li', 'doc3').returns('doc3')
20 helper.expects(:content_tag).with('ul', "doc1\ndoc2\ndoc3").returns('the_tag') 23 helper.expects(:content_tag).with('ul', "doc1\ndoc2\ndoc3").returns('the_tag')
21 24
22 assert_equal('the_tag', helper.instance_eval(&RecentDocumentsBlock.new.content)) 25 assert_equal('the_tag', helper.instance_eval(&RecentDocumentsBlock.new.content))