1
0
Fork 0
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:
Brad Murray 2013-10-15 11:06:50 +13:00
parent 828134b756
commit 89969dd711

View file

@ -217,6 +217,32 @@ class TemplateDigestorTest < ActionView::TestCase
ActionView::Resolver.caching = resolver_before ActionView::Resolver.caching = resolver_before
end 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 private
def assert_logged(message) def assert_logged(message)
old_logger = ActionView::Base.logger old_logger = ActionView::Base.logger