diff options
Diffstat (limited to 'activerecord/test/associations_go_eager_test.rb')
-rw-r--r-- | activerecord/test/associations_go_eager_test.rb | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/activerecord/test/associations_go_eager_test.rb b/activerecord/test/associations_go_eager_test.rb index 4e9c006d84..f345656cc2 100644 --- a/activerecord/test/associations_go_eager_test.rb +++ b/activerecord/test/associations_go_eager_test.rb @@ -222,17 +222,23 @@ class EagerAssociationTest < Test::Unit::TestCase def test_preconfigured_includes_with_has_many posts = authors(:david).posts_with_comments - assert_equal 2, posts.first.comments.size + one = posts.detect { |p| p.id == 1 } + assert_equal 5, posts.size + assert_equal 2, one.comments.size end def test_preconfigured_includes_with_habtm posts = authors(:david).posts_with_categories - assert_equal 2, posts.first.categories.size + one = posts.detect { |p| p.id == 1 } + assert_equal 5, posts.size + assert_equal 2, one.categories.size end def test_preconfigured_includes_with_has_many_and_habtm posts = authors(:david).posts_with_comments_and_categories - assert_equal 2, posts.first.comments.size - assert_equal 2, posts.first.categories.size + one = posts.detect { |p| p.id == 1 } + assert_equal 5, posts.size + assert_equal 2, one.comments.size + assert_equal 2, one.categories.size end end |