Permalink
Browse files

Added regression test for #8195.

  • Loading branch information...
jacobstr authored and rafaelfranca committed Nov 26, 2012
1 parent c720ff7 commit cc9958026409d7a4b76af555c0240db4428a071b
Showing with 18 additions and 0 deletions.
  1. +18 −0 activerecord/test/cases/cache_key_test.rb
@@ -0,0 +1,18 @@
+require "cases/helper"
+require "models/invoice"
+require "models/line_item"
+
+class CacheKeyTest < ActiveRecord::TestCase
+ def setup
+ @invoice = Invoice.create
+ LineItem.create(invoice: @invoice)
+ @invoice.reload
+ end
+
+ def test_cache_key_changes_when_child_touched
+ key = @invoice.cache_key
+ @invoice.line_items[0].touch
+ @invoice.reload
+ assert_not_equal key, @invoice.cache_key
+ end
+end

0 comments on commit cc99580

Please sign in to comment.