aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2011-01-24 22:25:32 +0000
committerJon Leighton <j@jonathanleighton.com>2011-01-30 11:58:08 +0000
commitb7bcc7e1905062f330e0a84b93a1ecacfea2a4c0 (patch)
tree5da246ed31edb652119ce028e1ec29939d664748 /activerecord/test/cases
parente8d7152a89f16a487a3d67d16a63bf065183b405 (diff)
downloadrails-b7bcc7e1905062f330e0a84b93a1ecacfea2a4c0.tar.gz
rails-b7bcc7e1905062f330e0a84b93a1ecacfea2a4c0.tar.bz2
rails-b7bcc7e1905062f330e0a84b93a1ecacfea2a4c0.zip
DRY up first/last and hence make last benefit from the bugfix in first
Diffstat (limited to 'activerecord/test/cases')
-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 2ca412d424..3bec9c97f4 100644
--- a/activerecord/test/cases/associations/has_many_associations_test.rb
+++ b/activerecord/test/cases/associations/has_many_associations_test.rb
@@ -86,10 +86,16 @@ class HasManyAssociationsTest < ActiveRecord::TestCase
Car.create(:name => 'honda')
bulbs = Car.first.bulbs
bulbs.inspect # to load all instances of bulbs
+
assert_no_queries do
bulbs.first()
bulbs.first({})
end
+
+ assert_no_queries do
+ bulbs.last()
+ bulbs.last({})
+ end
end
def test_create_resets_cached_counters