diff options
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/fixtures/mixins.yml | 4 | ||||
-rw-r--r-- | activerecord/test/mixin_nested_set_test.rb | 15 |
2 files changed, 10 insertions, 9 deletions
diff --git a/activerecord/test/fixtures/mixins.yml b/activerecord/test/fixtures/mixins.yml index 881b97c1d2..1f5d3ba60b 100644 --- a/activerecord/test/fixtures/mixins.yml +++ b/activerecord/test/fixtures/mixins.yml @@ -101,10 +101,10 @@ sti_set_<%= sti[0] %>: [4002, 4001, 2, 7], [4003, 4002, 3, 4], [4004, 4002, 5, 6], - [4005, 4001, 8, 13], + [4005, 4001, 14, 13], [4006, 4005, 9, 10], [4007, 4005, 11, 12], - [4008, 4001, 14, 19], + [4008, 4001, 8, 19], [4009, 4008, 15, 16], [4010, 4008, 17, 18]].each do |set| %> tree_<%= set[0] %>: 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 |