Commit 77649157dda240a65bbf85d60c78958d2dc3401f
1 parent
f3225d39
Exists in
master
and in
28 other branches
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
Showing
3 changed files
with
23 additions
and
0 deletions
Show diff stats
app/models/block.rb
| @@ -2,6 +2,10 @@ class Block < ActiveRecord::Base | @@ -2,6 +2,10 @@ class Block < ActiveRecord::Base | ||
| 2 | acts_as_list :scope => :box | 2 | acts_as_list :scope => :box |
| 3 | belongs_to :box | 3 | belongs_to :box |
| 4 | 4 | ||
| 5 | + def self.description | ||
| 6 | + _('A dummy block.') | ||
| 7 | + end | ||
| 8 | + | ||
| 5 | def content(main_content = nil) | 9 | def content(main_content = nil) |
| 6 | "This is block number %d" % self.id | 10 | "This is block number %d" % self.id |
| 7 | end | 11 | end |
| @@ -0,0 +1,10 @@ | @@ -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 |