Commit fdeb05ebc8bb9ef4a2dd30490152dbb5ed953987
1 parent
9b43a97d
Exists in
master
and in
23 other branches
ActionItem18: creating a proper list on RecentDocumentsBlock
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@433 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
4 additions
and
1 deletions
Show diff stats
app/models/recent_documents_block.rb
| ... | ... | @@ -4,7 +4,7 @@ class RecentDocumentsBlock < Design::Block |
| 4 | 4 | lambda do |
| 5 | 5 | content_tag( |
| 6 | 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 | 9 | end |
| 10 | 10 | end | ... | ... |
test/unit/recent_documents_block_test.rb
| ... | ... | @@ -15,8 +15,11 @@ class RecentDocumentsBlockTest < Test::Unit::TestCase |
| 15 | 15 | helper = mock |
| 16 | 16 | helper.expects(:profile).returns(profile) |
| 17 | 17 | helper.expects(:link_to_document).with(doc1).returns('doc1') |
| 18 | + helper.expects(:content_tag).with('li', 'doc1').returns('doc1') | |
| 18 | 19 | helper.expects(:link_to_document).with(doc2).returns('doc2') |
| 20 | + helper.expects(:content_tag).with('li', 'doc2').returns('doc2') | |
| 19 | 21 | helper.expects(:link_to_document).with(doc3).returns('doc3') |
| 22 | + helper.expects(:content_tag).with('li', 'doc3').returns('doc3') | |
| 20 | 23 | helper.expects(:content_tag).with('ul', "doc1\ndoc2\ndoc3").returns('the_tag') |
| 21 | 24 | |
| 22 | 25 | assert_equal('the_tag', helper.instance_eval(&RecentDocumentsBlock.new.content)) | ... | ... |