diff options
author | Takehiro Adachi <takehiro0740@gmail.com> | 2013-05-23 01:18:43 +0900 |
---|---|---|
committer | Takehiro Adachi <takehiro0740@gmail.com> | 2013-05-23 01:28:00 +0900 |
commit | 60c839cb1a5ab890397eebac252a5928c1166238 (patch) | |
tree | 6aa318ac42d6b986b620c680f101d86de5889b5d /activerecord | |
parent | b9bbc7f81a12e166230dbec383bdaa895b332588 (diff) | |
download | rails-60c839cb1a5ab890397eebac252a5928c1166238.tar.gz rails-60c839cb1a5ab890397eebac252a5928c1166238.tar.bz2 rails-60c839cb1a5ab890397eebac252a5928c1166238.zip |
Add test for AR::CounterCache.update_counters
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/counter_cache_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/cases/counter_cache_test.rb b/activerecord/test/cases/counter_cache_test.rb index 61f9d4cdae..b19966765e 100644 --- a/activerecord/test/cases/counter_cache_test.rb +++ b/activerecord/test/cases/counter_cache_test.rb @@ -127,6 +127,12 @@ class CounterCacheTest < ActiveRecord::TestCase end end + test 'update multiple counters' do + assert_difference ['@topic.reload.replies_count', '@topic.reload.unique_replies_count'], 2 do + Topic.update_counters @topic.id, replies_count: 2, unique_replies_count: 2 + end + end + test "update other counters on parent destroy" do david, joanna = dog_lovers(:david, :joanna) joanna = joanna # squelch a warning |