diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-01-12 05:33:09 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-01-12 05:33:09 +0000 |
commit | 8d3ff3abc757dee8c6538c1f26f839882786a5cc (patch) | |
tree | 7784271fea307ed5762c1bad32d905c13a7f2629 /activerecord/test/mixin_nested_set_test.rb | |
parent | ef4ac31de3f310c6426a6d9ebc86b4810ac6325b (diff) | |
download | rails-8d3ff3abc757dee8c6538c1f26f839882786a5cc.tar.gz rails-8d3ff3abc757dee8c6538c1f26f839882786a5cc.tar.bz2 rails-8d3ff3abc757dee8c6538c1f26f839882786a5cc.zip |
acts_as_nested_set works with single-table inheritance. Closes #6030.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5889 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/mixin_nested_set_test.rb')
-rw-r--r-- | activerecord/test/mixin_nested_set_test.rb | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/activerecord/test/mixin_nested_set_test.rb b/activerecord/test/mixin_nested_set_test.rb index 8764a6ac49..7ed9075bda 100644 --- a/activerecord/test/mixin_nested_set_test.rb +++ b/activerecord/test/mixin_nested_set_test.rb @@ -178,7 +178,19 @@ class MixinNestedSetTest < Test::Unit::TestCase mixins(:set_1).add_child mixins(:set_4) assert_equal( 3, mixins(:set_1).all_children.length ) - - + end + + def test_inheritance + parent = mixins(:sti_set_3100) + child = mixins(:sti_set_3101) + grandchild = mixins(:sti_set_3102) + assert_equal 5, parent.full_set.size + assert_equal 2, child.full_set.size + assert_equal 4, parent.all_children.size + assert_equal 1, child.all_children.size + assert_equal 2, parent.direct_children.size + assert_equal 1, child.direct_children.size + child.destroy + assert_equal 3, parent.full_set.size end end |