blob: e52bbd3d30903bb24b71cc8c466959e23bda711a (
plain) (
tree)
|
|
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
|