Skip to content
Browse files

Add explicit ordering in relations_test.rb, as the lack of this was c…

…ausing failures against postgres
  • Loading branch information...
1 parent d15de7d commit 383d545c88266ef579f225bc8bfb3d3b807ca5bc @jonleighton jonleighton committed Oct 19, 2010
Showing with 9 additions and 9 deletions.
  1. +9 −9 activerecord/test/cases/relations_test.rb
View
18 activerecord/test/cases/relations_test.rb
@@ -251,50 +251,50 @@ def test_eager_association_loading_of_stis_with_multiple_references
def test_find_with_preloaded_associations
assert_queries(2) do
- posts = Post.preload(:comments)
+ posts = Post.preload(:comments).order('posts.id')
assert posts.first.comments.first
end
assert_queries(2) do
- posts = Post.preload(:comments).to_a
+ posts = Post.preload(:comments).order('posts.id').to_a
assert posts.first.comments.first
end
assert_queries(2) do
- posts = Post.preload(:author)
+ posts = Post.preload(:author).order('posts.id')
assert posts.first.author
end
assert_queries(2) do
- posts = Post.preload(:author).to_a
+ posts = Post.preload(:author).order('posts.id').to_a
assert posts.first.author
end
assert_queries(3) do
- posts = Post.preload(:author, :comments).to_a
+ posts = Post.preload(:author, :comments).order('posts.id').to_a
assert posts.first.author
assert posts.first.comments.first
end
end
def test_find_with_included_associations
assert_queries(2) do
- posts = Post.includes(:comments)
+ posts = Post.includes(:comments).order('posts.id')
assert posts.first.comments.first
end
assert_queries(2) do
- posts = Post.scoped.includes(:comments)
+ posts = Post.scoped.includes(:comments).order('posts.id')
assert posts.first.comments.first
end
assert_queries(2) do
- posts = Post.includes(:author)
+ posts = Post.includes(:author).order('posts.id')
assert posts.first.author
end
assert_queries(3) do
- posts = Post.includes(:author, :comments).to_a
+ posts = Post.includes(:author, :comments).order('posts.id').to_a
assert posts.first.author
assert posts.first.comments.first
end

0 comments on commit 383d545

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