aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-05-01 11:55:13 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2011-05-01 11:55:13 -0700
commit23eb81a3d1eb154a3aefe569408d1bb2ed63c554 (patch)
tree070d62d2efab0b3af9f365676bed3538c3714f5b /activerecord/test
parent1800a6d1c8f400ce3ba5203489090d66025b9e4a (diff)
downloadrails-23eb81a3d1eb154a3aefe569408d1bb2ed63c554.tar.gz
rails-23eb81a3d1eb154a3aefe569408d1bb2ed63c554.tar.bz2
rails-23eb81a3d1eb154a3aefe569408d1bb2ed63c554.zip
assert_difference can take a callable piece of code rather than just evaling a string
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/associations/belongs_to_associations_test.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/test/cases/associations/belongs_to_associations_test.rb b/activerecord/test/cases/associations/belongs_to_associations_test.rb
index 7518bc19f9..ddcc36c841 100644
--- a/activerecord/test/cases/associations/belongs_to_associations_test.rb
+++ b/activerecord/test/cases/associations/belongs_to_associations_test.rb
@@ -576,11 +576,11 @@ class BelongsToAssociationsTest < ActiveRecord::TestCase
end
def test_polymorphic_counter_cache
- tagging = taggings(:welcome_general)
- post = post = posts(:welcome)
- comment = comments(:greetings)
+ tagging = taggings(:welcome_general)
+ post = posts(:welcome)
+ comment = comments(:greetings)
- assert_difference 'post.reload.taggings_count', -1 do
+ assert_difference lambda { post.reload.taggings_count }, -1 do
assert_difference 'comment.reload.taggings_count', +1 do
tagging.taggable = comment
end