mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
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
This commit is contained in:
parent
828134b756
commit
89969dd711
1 changed files with 26 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue