Commit 4370374ccd8afc6da44cd41923785e349bdb8232
1 parent
bff10113
Exists in
master
and in
29 other branches
ActionItem21: providing icon name
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@951 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
11 additions
and
0 deletions
Show diff stats
app/models/article.rb
@@ -24,4 +24,11 @@ class Article < ActiveRecord::Base | @@ -24,4 +24,11 @@ class Article < ActiveRecord::Base | ||
24 | body | 24 | body |
25 | end | 25 | end |
26 | 26 | ||
27 | + # provides the icon name to be used for this article. In this class this | ||
28 | + # method just returns 'text-html', but subclasses may (and should) override | ||
29 | + # to return their specific icons. | ||
30 | + def icon_name | ||
31 | + 'text-html' | ||
32 | + end | ||
33 | + | ||
27 | end | 34 | end |
test/unit/article_test.rb
@@ -66,4 +66,8 @@ class ArticleTest < Test::Unit::TestCase | @@ -66,4 +66,8 @@ class ArticleTest < Test::Unit::TestCase | ||
66 | assert_equal 'the body of the article', a.to_html | 66 | assert_equal 'the body of the article', a.to_html |
67 | end | 67 | end |
68 | 68 | ||
69 | + should 'inform the icon to be used' do | ||
70 | + assert_equal 'text-html', Article.new.icon_name | ||
71 | + end | ||
72 | + | ||
69 | end | 73 | end |