aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations/has_many_associations_test.rb
diff options
context:
space:
mode:
authorTarmo Tänav <tarmo@itech.ee>2008-08-26 19:29:16 +0300
committerJeremy Kemper <jeremy@bitsweat.net>2008-08-27 23:32:21 -0700
commit96c6fe084228d570dad80e3100830edb2bc0448d (patch)
treef573cc36df43094cb2b9f7a5cf6ba3406e5edb24 /activerecord/test/cases/associations/has_many_associations_test.rb
parent13671cc565aad2327f81a29789154b829ceeda04 (diff)
downloadrails-96c6fe084228d570dad80e3100830edb2bc0448d.tar.gz
rails-96c6fe084228d570dad80e3100830edb2bc0448d.tar.bz2
rails-96c6fe084228d570dad80e3100830edb2bc0448d.zip
Implement count limit/offset support for has_many associations
[#348 state:resolved] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'activerecord/test/cases/associations/has_many_associations_test.rb')
-rw-r--r--activerecord/test/cases/associations/has_many_associations_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/has_many_associations_test.rb b/activerecord/test/cases/associations/has_many_associations_test.rb
index da3c8fb28e..17fd88ce65 100644
--- a/activerecord/test/cases/associations/has_many_associations_test.rb
+++ b/activerecord/test/cases/associations/has_many_associations_test.rb
@@ -48,6 +48,12 @@ class HasManyAssociationsTest < ActiveRecord::TestCase
assert_equal 2, Firm.find(:first).plain_clients.count(:name)
end
+ def test_counting_with_association_limit
+ firm = companies(:first_firm)
+ assert_equal firm.limited_clients.length, firm.limited_clients.size
+ assert_equal firm.limited_clients.length, firm.limited_clients.count
+ end
+
def test_finding
assert_equal 2, Firm.find(:first).clients.length
end