Add a test that writes to the collection cache

上级 3077cdf9
......@@ -743,10 +743,17 @@ class CachedCustomer < Customer; end
end
teardown do
GC.start
I18n.reload!
end
test "template body written to cache" do
customer = Customer.new("david", 1)
key = cache_key(customer, "test/_customer")
assert_nil ActionView::PartialRenderer.collection_cache.read(key)
@view.render(partial: "test/customer", collection: [customer], cached: true)
assert_equal "Hello: david", ActionView::PartialRenderer.collection_cache.read(key)
end
test "collection caching does not cache by default" do
customer = Customer.new("david", 1)
key = cache_key(customer, "test/_customer")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册