Commit 2bc9351da94664a6ffda00aab1625cb48f5febb4
1 parent
016bb575
Exists in
master
and in
22 other branches
ActionItem102: adding HABTM between Region and organization
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@660 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
12 additions
and
0 deletions
Show diff stats
app/models/region.rb
test/unit/region_test.rb
| ... | ... | @@ -5,4 +5,15 @@ class RegionTest < Test::Unit::TestCase |
| 5 | 5 | should 'be a subclass of category' do |
| 6 | 6 | assert_equal Category, Region.superclass |
| 7 | 7 | end |
| 8 | + | |
| 9 | + should 'have an array of validators' do | |
| 10 | + region = Region.new | |
| 11 | + assert_raise ActiveRecord::AssociationTypeMismatch do | |
| 12 | + region.validators = [ 1 ] | |
| 13 | + end | |
| 14 | + assert_nothing_raised do | |
| 15 | + region.validators = [ Organization.new ] | |
| 16 | + end | |
| 17 | + end | |
| 18 | + | |
| 8 | 19 | end | ... | ... |