Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added regression test for #8195.

  • Loading branch information...
commit 567cdd1f29850d66e4b895be2eba4a100df51371 1 parent d9039cd
@jacobstr jacobstr authored rafaelfranca committed
Showing with 18 additions and 0 deletions.
  1. +18 −0 activerecord/test/cases/cache_key_test.rb
View
18 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
Please sign in to comment.
Something went wrong with that request. Please try again.