aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2010-10-19 19:33:25 +0100
committerJon Leighton <j@jonathanleighton.com>2010-10-19 19:33:25 +0100
commit383d545c88266ef579f225bc8bfb3d3b807ca5bc (patch)
tree8848cf38692acd9277e0d4f271ad9f569ad40c2b /activerecord/test/cases
parentd15de7d97f7080d8d3bc47bef89aa8a922f04c67 (diff)
downloadrails-383d545c88266ef579f225bc8bfb3d3b807ca5bc.tar.gz
rails-383d545c88266ef579f225bc8bfb3d3b807ca5bc.tar.bz2
rails-383d545c88266ef579f225bc8bfb3d3b807ca5bc.zip
Add explicit ordering in relations_test.rb, as the lack of this was causing failures against postgres
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r--activerecord/test/cases/relations_test.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb
index 0d88c8eded..0b143224be 100644
--- a/activerecord/test/cases/relations_test.rb
+++ b/activerecord/test/cases/relations_test.rb
@@ -251,27 +251,27 @@ class RelationTest < ActiveRecord::TestCase
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
@@ -279,22 +279,22 @@ class RelationTest < ActiveRecord::TestCase
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