public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Fix yet another implicit order dependant test

Signed-off-by: Michael Koziarski <michael@koziarski.com>
Tarmo Tänav (author)
Tue Aug 26 04:15:44 -0700 2008
NZKoz (committer)
Tue Aug 26 04:16:55 -0700 2008
commit  eec5eb2e444b2b42206e2d5ccfe7f30306c308cb
tree    4b10b7bac08aac3b4eebb071afa2b752667d3d58
parent  3dfecfe77347421fbb54be70a5a84eb47c30acb6
...
260
261
262
263
264
265
 
 
 
266
267
268
...
260
261
262
 
 
 
263
264
265
266
267
268
0
@@ -260,9 +260,9 @@ class EagerAssociationTest < ActiveRecord::TestCase
0
   end
0
 
0
   def test_eager_with_has_many_through
0
-    posts_with_comments = people(:michael).posts.find(:all, :include => :comments)
0
-    posts_with_author = people(:michael).posts.find(:all, :include => :author )
0
-    posts_with_comments_and_author = people(:michael).posts.find(:all, :include => [ :comments, :author ])
0
+    posts_with_comments = people(:michael).posts.find(:all, :include => :comments, :order => 'posts.id')
0
+    posts_with_author = people(:michael).posts.find(:all, :include => :author, :order => 'posts.id')
0
+    posts_with_comments_and_author = people(:michael).posts.find(:all, :include => [ :comments, :author ], :order => 'posts.id')
0
     assert_equal 2, posts_with_comments.inject(0) { |sum, post| sum += post.comments.size }
0
     assert_equal authors(:david), assert_no_queries { posts_with_author.first.author }
0
     assert_equal authors(:david), assert_no_queries { posts_with_comments_and_author.first.author }

Comments