diff options
author | Brad Murray <wyaeld@gmail.com> | 2013-10-15 11:06:50 +1300 |
---|---|---|
committer | Brad Murray <wyaeld@gmail.com> | 2013-10-15 11:06:50 +1300 |
commit | 89969dd7116cc433382f3f796f33fad3f6d461be (patch) | |
tree | ac92704c2b6c6045547d2a5adc37940728318ebb /actionview/test/template | |
parent | 828134b7561bf4473580d76bd8d7ae97e9b1db92 (diff) | |
download | rails-89969dd7116cc433382f3f796f33fad3f6d461be.tar.gz rails-89969dd7116cc433382f3f796f33fad3f6d461be.tar.bz2 rails-89969dd7116cc433382f3f796f33fad3f6d461be.zip |
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
Diffstat (limited to 'actionview/test/template')
-rw-r--r-- | actionview/test/template/digestor_test.rb | 26 |
1 files changed, 26 insertions, 0 deletions
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 |