aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2008-11-26 20:04:00 +0100
committerDavid Heinemeier Hansson <david@loudthinking.com>2008-11-26 20:04:00 +0100
commite2362babdf16079727966dea046bdd2ee67e716d (patch)
tree57d03786603e85292dd16b1194ccf5fc78028bd8 /activerecord/test/cases
parent4999d52e08a02ebba344f6c318f0af4b5b18f0e5 (diff)
parent9a4d557713acb0fc8e80f61af18094034aca029a (diff)
downloadrails-e2362babdf16079727966dea046bdd2ee67e716d.tar.gz
rails-e2362babdf16079727966dea046bdd2ee67e716d.tar.bz2
rails-e2362babdf16079727966dea046bdd2ee67e716d.zip
Merge branch 'master' of git@github.com:rails/rails
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r--activerecord/test/cases/associations/eager_test.rb20
1 files changed, 18 insertions, 2 deletions
diff --git a/activerecord/test/cases/associations/eager_test.rb b/activerecord/test/cases/associations/eager_test.rb
index a4f1f65f9a..3c8408d14b 100644
--- a/activerecord/test/cases/associations/eager_test.rb
+++ b/activerecord/test/cases/associations/eager_test.rb
@@ -385,12 +385,28 @@ class EagerAssociationTest < ActiveRecord::TestCase
assert_equal count, posts.size
end
- def test_eager_with_has_many_and_limit_ond_high_offset
+ def test_eager_with_has_many_and_limit_and_high_offset
posts = Post.find(:all, :include => [ :author, :comments ], :limit => 2, :offset => 10, :conditions => [ "authors.name = ?", 'David' ])
assert_equal 0, posts.size
end
- def test_count_eager_with_has_many_and_limit_ond_high_offset
+ def test_eager_with_has_many_and_limit_and_high_offset_and_multiple_array_conditions
+ assert_queries(1) do
+ posts = Post.find(:all, :include => [ :author, :comments ], :limit => 2, :offset => 10,
+ :conditions => [ "authors.name = ? and comments.body = ?", 'David', 'go crazy' ])
+ assert_equal 0, posts.size
+ end
+ end
+
+ def test_eager_with_has_many_and_limit_and_high_offset_and_multiple_hash_conditions
+ assert_queries(1) do
+ posts = Post.find(:all, :include => [ :author, :comments ], :limit => 2, :offset => 10,
+ :conditions => { 'authors.name' => 'David', 'comments.body' => 'go crazy' })
+ assert_equal 0, posts.size
+ end
+ end
+
+ def test_count_eager_with_has_many_and_limit_and_high_offset
posts = Post.count(:all, :include => [ :author, :comments ], :limit => 2, :offset => 10, :conditions => [ "authors.name = ?", 'David' ])
assert_equal 0, posts
end