Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix yet another implicit order dependant test

Signed-off-by: Michael Koziarski <michael@koziarski.com>
  • Loading branch information...
commit eec5eb2e444b2b42206e2d5ccfe7f30306c308cb 1 parent 3dfecfe
@tarmo tarmo authored NZKoz committed
Showing with 3 additions and 3 deletions.
  1. +3 −3 activerecord/test/cases/associations/eager_test.rb
View
6 activerecord/test/cases/associations/eager_test.rb
@@ -260,9 +260,9 @@ def test_eager_association_loading_with_explicit_join
end
def test_eager_with_has_many_through
- posts_with_comments = people(:michael).posts.find(:all, :include => :comments)
- posts_with_author = people(:michael).posts.find(:all, :include => :author )
- posts_with_comments_and_author = people(:michael).posts.find(:all, :include => [ :comments, :author ])
+ posts_with_comments = people(:michael).posts.find(:all, :include => :comments, :order => 'posts.id')
+ posts_with_author = people(:michael).posts.find(:all, :include => :author, :order => 'posts.id')
+ posts_with_comments_and_author = people(:michael).posts.find(:all, :include => [ :comments, :author ], :order => 'posts.id')
assert_equal 2, posts_with_comments.inject(0) { |sum, post| sum += post.comments.size }
assert_equal authors(:david), assert_no_queries { posts_with_author.first.author }
assert_equal authors(:david), assert_no_queries { posts_with_comments_and_author.first.author }

0 comments on commit eec5eb2

Please sign in to comment.
Something went wrong with that request. Please try again.