diff options
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/associations_go_eager_test.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/activerecord/test/associations_go_eager_test.rb b/activerecord/test/associations_go_eager_test.rb index 460365bbdc..29a0e8a443 100644 --- a/activerecord/test/associations_go_eager_test.rb +++ b/activerecord/test/associations_go_eager_test.rb @@ -11,8 +11,9 @@ class EagerAssociationTest < Test::Unit::TestCase def test_loading_with_one_association posts = Post.find(:all, :include => :comments) - assert_equal 2, posts.first.comments.size - assert posts.first.comments.include?(comments(:greetings)) + post = posts.find { |p| p.id == 1 } + assert_equal 2, post.comments.size + assert post.comments.include?(comments(:greetings)) post = Post.find(:first, :include => :comments, :conditions => "posts.title = 'Welcome to the weblog'") assert_equal 2, post.comments.size |