Commit 77649157dda240a65bbf85d60c78958d2dc3401f

Authored by AntonioTerceiro
1 parent f3225d39

ActionItem152: adding some tests for blocks (too few for now, though)


git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1216 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/models/block.rb
... ... @@ -2,6 +2,10 @@ class Block < ActiveRecord::Base
2 2 acts_as_list :scope => :box
3 3 belongs_to :box
4 4  
  5 + def self.description
  6 + _('A dummy block.')
  7 + end
  8 +
5 9 def content(main_content = nil)
6 10 "This is block number %d" % self.id
7 11 end
... ...
test/unit/block_test.rb 0 → 100644
... ... @@ -0,0 +1,9 @@
  1 +require File.dirname(__FILE__) + '/../test_helper'
  2 +
  3 +class BlockTest < Test::Unit::TestCase
  4 +
  5 + should 'describe itself' do
  6 + assert_kind_of String, Block.description
  7 + end
  8 +
  9 +end
... ...
test/unit/main_block_test.rb 0 → 100644
... ... @@ -0,0 +1,10 @@
  1 +require File.dirname(__FILE__) + '/../test_helper'
  2 +
  3 +class MainBlockTest < Test::Unit::TestCase
  4 +
  5 + should 'describe itself' do
  6 + assert_kind_of String, MainBlock.description
  7 + assert_not_equal Block.description, MainBlock.description
  8 + end
  9 +
  10 +end
... ...