From 77649157dda240a65bbf85d60c78958d2dc3401f Mon Sep 17 00:00:00 2001 From: AntonioTerceiro Date: Fri, 18 Jan 2008 18:28:27 +0000 Subject: [PATCH] ActionItem152: adding some tests for blocks (too few for now, though) --- app/models/block.rb | 4 ++++ test/unit/block_test.rb | 9 +++++++++ test/unit/main_block_test.rb | 10 ++++++++++ 3 files changed, 23 insertions(+), 0 deletions(-) create mode 100644 test/unit/block_test.rb create mode 100644 test/unit/main_block_test.rb diff --git a/app/models/block.rb b/app/models/block.rb index 7140b89..012743f 100644 --- a/app/models/block.rb +++ b/app/models/block.rb @@ -2,6 +2,10 @@ class Block < ActiveRecord::Base acts_as_list :scope => :box belongs_to :box + def self.description + _('A dummy block.') + end + def content(main_content = nil) "This is block number %d" % self.id end diff --git a/test/unit/block_test.rb b/test/unit/block_test.rb new file mode 100644 index 0000000..d628211 --- /dev/null +++ b/test/unit/block_test.rb @@ -0,0 +1,9 @@ +require File.dirname(__FILE__) + '/../test_helper' + +class BlockTest < Test::Unit::TestCase + + should 'describe itself' do + assert_kind_of String, Block.description + end + +end diff --git a/test/unit/main_block_test.rb b/test/unit/main_block_test.rb new file mode 100644 index 0000000..4e532b5 --- /dev/null +++ b/test/unit/main_block_test.rb @@ -0,0 +1,10 @@ +require File.dirname(__FILE__) + '/../test_helper' + +class MainBlockTest < Test::Unit::TestCase + + should 'describe itself' do + assert_kind_of String, MainBlock.description + assert_not_equal Block.description, MainBlock.description + end + +end -- libgit2 0.21.2