Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

test case to reproduce #3891 => passes

  • Loading branch information...
commit cc3c966fcc37552aa445ac1eb169f126321a5468 1 parent 772883c
Yves Senn authored November 08, 2012
8  activerecord/test/cases/associations/has_many_associations_test.rb
@@ -728,6 +728,14 @@ def test_deleting_updates_counter_cache
728 728
     assert_equal topic.replies.to_a.size, topic.replies_count
729 729
   end
730 730
 
  731
+  def tests_creating_a_comments_with_posts_increments_counter_using_push
  732
+    topic = Topic.order("id ASC").first
  733
+
  734
+    assert_difference "topic.reload.replies_count", 1 do
  735
+      topic.replies << Reply.new
  736
+    end
  737
+  end
  738
+
731 739
   def test_deleting_updates_counter_cache_without_dependent_option
732 740
     post = posts(:welcome)
733 741
 

0 notes on commit cc3c966

Please sign in to comment.
Something went wrong with that request. Please try again.