From 5a16fa8d0b0c389f50a22ea6da3670f27ffbe2ba Mon Sep 17 00:00:00 2001 From: AntonioTerceiro Date: Fri, 28 Dec 2007 12:49:35 +0000 Subject: [PATCH] ActionItem24: providing description --- app/models/uploaded_file.rb | 8 ++++++++ test/unit/uploaded_file_test.rb | 11 +++++++++++ 2 files changed, 19 insertions(+), 0 deletions(-) diff --git a/app/models/uploaded_file.rb b/app/models/uploaded_file.rb index 556d62e..6132067 100644 --- a/app/models/uploaded_file.rb +++ b/app/models/uploaded_file.rb @@ -11,4 +11,12 @@ class UploadedFile < Article content_type end + def self.short_description + _("Uploaded file") + end + + def self.description + _('Upload any kind of file you want.') + end + end diff --git a/test/unit/uploaded_file_test.rb b/test/unit/uploaded_file_test.rb index f99edd9..305cfca 100644 --- a/test/unit/uploaded_file_test.rb +++ b/test/unit/uploaded_file_test.rb @@ -21,4 +21,15 @@ class UploadedFileTest < Test::Unit::TestCase f.expects(:content_type).returns('application/pdf') assert_equal 'application/pdf', f.mime_type end + + should 'provide proper description' do + UploadedFile.stubs(:==).with(Article).returns(true) + assert_not_equal Article.description, UploadedFile.description + end + + should 'provide proper short description' do + UploadedFile.stubs(:==).with(Article).returns(true) + assert_not_equal Article.short_description, UploadedFile.short_description + end + end -- libgit2 0.21.2