Permalink
Browse files

test case to reproduce #3891 => passes

  • Loading branch information...
1 parent 772883c commit cc3c966fcc37552aa445ac1eb169f126321a5468 @senny committed Nov 8, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 activerecord/test/cases/associations/has_many_associations_test.rb
View
8 activerecord/test/cases/associations/has_many_associations_test.rb
@@ -728,6 +728,14 @@ def test_deleting_updates_counter_cache
assert_equal topic.replies.to_a.size, topic.replies_count
end
+ def tests_creating_a_comments_with_posts_increments_counter_using_push
+ topic = Topic.order("id ASC").first
+
+ assert_difference "topic.reload.replies_count", 1 do
+ topic.replies << Reply.new
+ end
+ end
+
def test_deleting_updates_counter_cache_without_dependent_option
post = posts(:welcome)

0 comments on commit cc3c966

Please sign in to comment.