From ea0975a20b0752bfbfcafe8eefd98f7fe9bcd386 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Tue, 11 Sep 2007 03:25:59 +0000 Subject: Moved acts_as_tree into a plugin of the same name on the official Rails svn (closes #9514) [lifofifo] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7454 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- .../associations/cascaded_eager_loading_test.rb | 27 ---------------------- 1 file changed, 27 deletions(-) (limited to 'activerecord/test/associations/cascaded_eager_loading_test.rb') diff --git a/activerecord/test/associations/cascaded_eager_loading_test.rb b/activerecord/test/associations/cascaded_eager_loading_test.rb index 78b9861d54..1d8f853e07 100644 --- a/activerecord/test/associations/cascaded_eager_loading_test.rb +++ b/activerecord/test/associations/cascaded_eager_loading_test.rb @@ -5,7 +5,6 @@ require 'fixtures/comment' require 'fixtures/author' require 'fixtures/category' require 'fixtures/categorization' -require 'fixtures/mixin' require 'fixtures/company' require 'fixtures/topic' require 'fixtures/reply' @@ -53,16 +52,6 @@ class CascadedEagerLoadingTest < Test::Unit::TestCase assert_equal 5, authors[0].posts.size end - def test_eager_association_loading_with_acts_as_tree - roots = TreeMixin.find(:all, :include=>"children", :conditions=>"mixins.parent_id IS NULL", :order=>"mixins.id") - assert_equal mixins(:tree_1, :tree2_1, :tree3_1), roots - assert_no_queries do - assert_equal 2, roots[0].children.size - assert_equal 0, roots[1].children.size - assert_equal 0, roots[2].children.size - end - end - def test_eager_association_loading_with_cascaded_three_levels_by_ping_pong firms = Firm.find(:all, :include=>{:account=>{:firm=>:account}}, :order=>"companies.id") assert_equal 2, firms.size @@ -103,24 +92,8 @@ class CascadedEagerLoadingTest < Test::Unit::TestCase authors.first.posts.first.special_comments.first.post.very_special_comment end end - - def test_eager_association_loading_with_recursive_cascading_three_levels_has_many - root_node = RecursivelyCascadedTreeMixin.find(:first, :include=>{:children=>{:children=>:children}}, :order => 'mixins.id') - assert_equal mixins(:recursively_cascaded_tree_4), assert_no_queries { root_node.children.first.children.first.children.first } - end - - def test_eager_association_loading_with_recursive_cascading_three_levels_has_one - root_node = RecursivelyCascadedTreeMixin.find(:first, :include=>{:first_child=>{:first_child=>:first_child}}, :order => 'mixins.id') - assert_equal mixins(:recursively_cascaded_tree_4), assert_no_queries { root_node.first_child.first_child.first_child } - end - - def test_eager_association_loading_with_recursive_cascading_three_levels_belongs_to - leaf_node = RecursivelyCascadedTreeMixin.find(:first, :include=>{:parent=>{:parent=>:parent}}, :order => 'mixins.id DESC') - assert_equal mixins(:recursively_cascaded_tree_1), assert_no_queries { leaf_node.parent.parent.parent } - end end - require 'fixtures/vertex' require 'fixtures/edge' class CascadedEagerLoadingTest < Test::Unit::TestCase -- cgit v1.2.3