blob: e52bbd3d30903bb24b71cc8c466959e23bda711a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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
|