diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2019-02-13 17:08:42 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2019-02-19 13:46:09 -0800 |
commit | 4f77982e213e31d9c6e7195c7db86429b8092744 (patch) | |
tree | 1ab3b71a28d46a3b50b4064eb5ba7d1841e7cba6 /actionview | |
parent | 3077cdf921fed35c1e743db5911d7e4b589a684e (diff) | |
download | rails-4f77982e213e31d9c6e7195c7db86429b8092744.tar.gz rails-4f77982e213e31d9c6e7195c7db86429b8092744.tar.bz2 rails-4f77982e213e31d9c6e7195c7db86429b8092744.zip |
Add a test that writes to the collection cache
Diffstat (limited to 'actionview')
-rw-r--r-- | actionview/test/template/render_test.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/actionview/test/template/render_test.rb b/actionview/test/template/render_test.rb index 5068e00c7d..8d28f71585 100644 --- a/actionview/test/template/render_test.rb +++ b/actionview/test/template/render_test.rb @@ -743,10 +743,17 @@ class CachedCollectionViewRenderTest < ActiveSupport::TestCase 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") |