aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2011-03-18 23:14:45 +0000
committerJon Leighton <j@jonathanleighton.com>2011-03-18 23:14:45 +0000
commit5b84aebd14fdb1aa9746a8404589c9ada4bcbcbb (patch)
treeef1ecdbb4eb926a3278892902ea14c6d638c12f4 /activerecord
parent8aaf3c1e553d18b40d9980951d496bffad56f37b (diff)
downloadrails-5b84aebd14fdb1aa9746a8404589c9ada4bcbcbb.tar.gz
rails-5b84aebd14fdb1aa9746a8404589c9ada4bcbcbb.tar.bz2
rails-5b84aebd14fdb1aa9746a8404589c9ada4bcbcbb.zip
Add order clauses to fix some tests which were failing under 1.8 on oracle and postgres
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/test/cases/identity_map_test.rb18
-rw-r--r--activerecord/test/cases/relations_test.rb10
2 files changed, 14 insertions, 14 deletions
diff --git a/activerecord/test/cases/identity_map_test.rb b/activerecord/test/cases/identity_map_test.rb
index 399d6c26df..89f7b92d09 100644
--- a/activerecord/test/cases/identity_map_test.rb
+++ b/activerecord/test/cases/identity_map_test.rb
@@ -207,31 +207,31 @@ class IdentityMapTest < 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
# With IM we'll retrieve post object from previous query, it'll have comments
# already preloaded from first call
assert_queries(1) do
- posts = Post.preload(:comments).to_a
+ posts = Post.preload(:comments).order('posts.id')
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
# With IM we'll retrieve post object from previous query, it'll have comments
# already preloaded from first call
assert_queries(1) do
- posts = Post.preload(:author).to_a
+ posts = Post.preload(:author).order('posts.id')
assert posts.first.author
end
assert_queries(1) do
- posts = Post.preload(:author, :comments).to_a
+ posts = Post.preload(:author, :comments).order('posts.id')
assert posts.first.author
assert posts.first.comments.first
end
@@ -239,22 +239,22 @@ class IdentityMapTest < 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(1) 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(1) do
- posts = Post.includes(:author, :comments).to_a
+ posts = Post.includes(:author, :comments).order('posts.id')
assert posts.first.author
assert posts.first.comments.first
end
diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb
index 680e1d50cf..94916f61c5 100644
--- a/activerecord/test/cases/relations_test.rb
+++ b/activerecord/test/cases/relations_test.rb
@@ -286,7 +286,7 @@ class RelationTest < ActiveRecord::TestCase
end
assert_queries(ActiveRecord::IdentityMap.enabled? ? 1 : 2) do
- posts = Post.preload(:comments).to_a
+ posts = Post.preload(:comments).order('posts.id')
assert posts.first.comments.first
end
@@ -296,12 +296,12 @@ class RelationTest < ActiveRecord::TestCase
end
assert_queries(ActiveRecord::IdentityMap.enabled? ? 1 : 2) do
- posts = Post.preload(:author).to_a
+ posts = Post.preload(:author).order('posts.id')
assert posts.first.author
end
assert_queries(ActiveRecord::IdentityMap.enabled? ? 1 : 3) do
- posts = Post.preload(:author, :comments).to_a
+ posts = Post.preload(:author, :comments).order('posts.id')
assert posts.first.author
assert posts.first.comments.first
end
@@ -314,7 +314,7 @@ class RelationTest < ActiveRecord::TestCase
end
assert_queries(ActiveRecord::IdentityMap.enabled? ? 1 : 2) do
- posts = Post.scoped.includes(:comments)
+ posts = Post.scoped.includes(:comments).order('posts.id')
assert posts.first.comments.first
end
@@ -324,7 +324,7 @@ class RelationTest < ActiveRecord::TestCase
end
assert_queries(ActiveRecord::IdentityMap.enabled? ? 1 : 3) do
- posts = Post.includes(:author, :comments).to_a
+ posts = Post.includes(:author, :comments).order('posts.id')
assert posts.first.author
assert posts.first.comments.first
end