Commit f3b2d6beb1cf1d6c415c3956b465efc9e4e171db
Committed by
Joenio Costa
1 parent
88ac72d6
Exists in
master
and in
29 other branches
ActionItem1101: published articles should return to_html as reference_article does
Showing
2 changed files
with
18 additions
and
0 deletions
Show diff stats
app/models/published_article.rb
test/unit/published_article_test.rb
... | ... | @@ -92,4 +92,19 @@ class PublishedArticleTest < ActiveSupport::TestCase |
92 | 92 | assert p |
93 | 93 | assert_equal folder, p.parent |
94 | 94 | end |
95 | + | |
96 | + should 'use to_html from reference_article' do | |
97 | + prof = Community.create!(:name => 'test_comm', :identifier => 'test_comm') | |
98 | + p = PublishedArticle.create!(:reference_article => @article, :profile => prof) | |
99 | + | |
100 | + assert_equal @article.to_html, p.to_html | |
101 | + end | |
102 | + | |
103 | + should 'use to_html from reference_article when is Textile' do | |
104 | + prof = Community.create!(:name => 'test_comm', :identifier => 'test_comm') | |
105 | + textile_article = TextileArticle.new(:name => 'textile_article', :body => '*my text*', :profile => prof) | |
106 | + p = PublishedArticle.create!(:reference_article => textile_article, :profile => prof) | |
107 | + | |
108 | + assert_equal textile_article.to_html, p.to_html | |
109 | + end | |
95 | 110 | end | ... | ... |