From 89969dd7116cc433382f3f796f33fad3f6d461be Mon Sep 17 00:00:00 2001 From: Brad Murray Date: Tue, 15 Oct 2013 11:06:50 +1300 Subject: Add 2 tests, 1 of which fails, to isolate the digest_caching behaviour causing #12521 If config.action_view.cache_template_loading = false, most likely in a development configuration if config.cache_classes = false & config.action_controller.perform_caching = true. config.action_view.cache_template_loading defaults to the value of config.cache_classes --- actionview/test/template/digestor_test.rb | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'actionview/test/template') diff --git a/actionview/test/template/digestor_test.rb b/actionview/test/template/digestor_test.rb index 0f6b14a57d..00bdfad3b7 100644 --- a/actionview/test/template/digestor_test.rb +++ b/actionview/test/template/digestor_test.rb @@ -217,6 +217,32 @@ class TemplateDigestorTest < ActionView::TestCase ActionView::Resolver.caching = resolver_before end + def test_digest_cache_cleanup_with_recursion + first_digest = digest("level/_recursion") + second_digest = digest("level/_recursion") + + assert first_digest + + # If the cache is cleaned up correctly, subsequent digests should return the same + assert_equal first_digest, second_digest + end + + def test_digest_cache_cleanup_with_recursion_and_template_caching_off + resolver_before = ActionView::Resolver.caching + ActionView::Resolver.caching = false + + first_digest = digest("level/_recursion") + second_digest = digest("level/_recursion") + + assert first_digest + + # If the cache is cleaned up correctly, subsequent digests should return the same + assert_equal first_digest, second_digest + + ActionView::Resolver.caching = resolver_before + end + + private def assert_logged(message) old_logger = ActionView::Base.logger -- cgit v1.2.3