diff options
Diffstat (limited to 'activerecord/test/associations_go_eager_test.rb')
-rw-r--r-- | activerecord/test/associations_go_eager_test.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/activerecord/test/associations_go_eager_test.rb b/activerecord/test/associations_go_eager_test.rb index 20ea9656b8..a3e819e028 100644 --- a/activerecord/test/associations_go_eager_test.rb +++ b/activerecord/test/associations_go_eager_test.rb @@ -17,6 +17,13 @@ class EagerAssociationTest < Test::Unit::TestCase assert post.comments.include?(@greetings) end + def test_with_ordering + posts = Post.find(:all, :include => :comments, :order => "posts.id DESC") + assert_equal @authorless, posts[0] + assert_equal @thinking, posts[1] + assert_equal @welcome, posts[2] + end + def test_loading_with_multiple_associations posts = Post.find(:all, :include => [ :comments, :author, :categories ], :order => "posts.id") assert_equal 2, posts.first.comments.size @@ -25,7 +32,7 @@ class EagerAssociationTest < Test::Unit::TestCase end def test_loading_from_an_association - posts = @david.posts.find(:all, :include => :comments, :order => "posts.id DESC") + posts = @david.posts.find(:all, :include => :comments, :order => "posts.id") assert_equal 2, posts.first.comments.size end |