From 4370374ccd8afc6da44cd41923785e349bdb8232 Mon Sep 17 00:00:00 2001 From: AntonioTerceiro Date: Mon, 26 Nov 2007 18:53:59 +0000 Subject: [PATCH] ActionItem21: providing icon name --- app/models/article.rb | 7 +++++++ test/unit/article_test.rb | 4 ++++ 2 files changed, 11 insertions(+), 0 deletions(-) diff --git a/app/models/article.rb b/app/models/article.rb index e25e015..e7ff79c 100644 --- a/app/models/article.rb +++ b/app/models/article.rb @@ -24,4 +24,11 @@ class Article < ActiveRecord::Base body end + # provides the icon name to be used for this article. In this class this + # method just returns 'text-html', but subclasses may (and should) override + # to return their specific icons. + def icon_name + 'text-html' + end + end diff --git a/test/unit/article_test.rb b/test/unit/article_test.rb index 6e8e865..6f026ed 100644 --- a/test/unit/article_test.rb +++ b/test/unit/article_test.rb @@ -66,4 +66,8 @@ class ArticleTest < Test::Unit::TestCase assert_equal 'the body of the article', a.to_html end + should 'inform the icon to be used' do + assert_equal 'text-html', Article.new.icon_name + end + end -- libgit2 0.21.2