Commit 9db7323146985267a4dd71596a77a2d4101a0093
1 parent
92a1dd6b
Exists in
master
and in
29 other branches
ActionItem158: displaying the description of the folders
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1793 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
5 changed files
with
10 additions
and
4 deletions
Show diff stats
app/models/folder.rb
... | ... | @@ -17,6 +17,7 @@ class Folder < Article |
17 | 17 | include ActionView::Helpers::UrlHelper |
18 | 18 | include ActionController::UrlWriter |
19 | 19 | def to_html |
20 | + content_tag('div', body) + | |
20 | 21 | content_tag('ul', children.map { |child| content_tag('li', link_to(child.name, child.url)) }, :class => 'folder-listing') |
21 | 22 | end |
22 | 23 | ... | ... |
app/views/cms/_folder.rhtml
app/views/cms/_textile_article.rhtml
app/views/cms/_tiny_mce_article.rhtml
test/unit/folder_test.rb
... | ... | @@ -30,6 +30,13 @@ class FolderTest < ActiveSupport::TestCase |
30 | 30 | assert_match(/<li><a href=".*\/testuser\/f\/otherarticle">otherarticle<\/a><\/li>/, f.to_html) |
31 | 31 | end |
32 | 32 | |
33 | + should 'show text body in HTML content' do | |
34 | + p = create_user('testuser').person | |
35 | + f = Folder.create!(:name => 'f', :profile => p, :body => 'this-is-the-text') | |
36 | + | |
37 | + assert_match(/this-is-the-text/, f.to_html) | |
38 | + end | |
39 | + | |
33 | 40 | should 'identify as folder' do |
34 | 41 | assert Folder.new.folder?, 'folder must identity itself as folder' |
35 | 42 | end | ... | ... |