diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-05-30 06:34:25 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-05-30 06:34:25 +0000 |
commit | b2681cca2e38b7465cd94d51dde14e53b724d0d1 (patch) | |
tree | a4be865f8a2e159236acb234505d08408a6e8556 /activerecord/test/mixin_nested_set_test.rb | |
parent | b7d2dae6dcf00b38a1dba8687d6b70d863da915e (diff) | |
download | rails-b2681cca2e38b7465cd94d51dde14e53b724d0d1.tar.gz rails-b2681cca2e38b7465cd94d51dde14e53b724d0d1.tar.bz2 rails-b2681cca2e38b7465cd94d51dde14e53b724d0d1.zip |
acts_as_nested_set: direct_children is sorted correctly. Closes #4761.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6903 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 | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/activerecord/test/mixin_nested_set_test.rb b/activerecord/test/mixin_nested_set_test.rb index 7ed9075bda..87fa140dc9 100644 --- a/activerecord/test/mixin_nested_set_test.rb +++ b/activerecord/test/mixin_nested_set_test.rb @@ -116,12 +116,13 @@ class MixinNestedSetTest < Test::Unit::TestCase # Make sure we have the right one assert_equal( 3, big_tree.direct_children.length ) assert_equal( 10, big_tree.full_set.length ) + assert_equal [4002, 4008, 4005], big_tree.direct_children.map(&:id) NestedSetWithStringScope.find( 4005 ).destroy big_tree = NestedSetWithStringScope.find( 4001 ) - assert_equal( 7, big_tree.full_set.length ) + assert_equal( 9, big_tree.full_set.length ) assert_equal( 2, big_tree.direct_children.length ) assert_equal( 1, NestedSetWithStringScope.find(4001).lft ) @@ -132,12 +133,12 @@ class MixinNestedSetTest < Test::Unit::TestCase assert_equal( 6, NestedSetWithStringScope.find(4004).rgt ) assert_equal( 7, NestedSetWithStringScope.find(4002).rgt ) assert_equal( 8, NestedSetWithStringScope.find(4008).lft ) - assert_equal( 9, NestedSetWithStringScope.find(4009).lft ) - assert_equal(10, NestedSetWithStringScope.find(4009).rgt ) - assert_equal(11, NestedSetWithStringScope.find(4010).lft ) - assert_equal(12, NestedSetWithStringScope.find(4010).rgt ) - assert_equal(13, NestedSetWithStringScope.find(4008).rgt ) - assert_equal(14, NestedSetWithStringScope.find(4001).rgt ) + assert_equal(15, NestedSetWithStringScope.find(4009).lft ) + assert_equal(16, NestedSetWithStringScope.find(4009).rgt ) + assert_equal(17, NestedSetWithStringScope.find(4010).lft ) + assert_equal(18, NestedSetWithStringScope.find(4010).rgt ) + assert_equal(19, NestedSetWithStringScope.find(4008).rgt ) + assert_equal(20, NestedSetWithStringScope.find(4001).rgt ) end def test_deleting_root |