diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2013-01-08 10:29:50 -0800 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2013-01-08 10:29:50 -0800 |
commit | 64e3660ff0c0fd708fd4fc5455c54bf3d511032b (patch) | |
tree | 59ea8b888d7bc9c99cdcfab3ad4bf0f346244054 /actionpack/test/template | |
parent | ac86cbec82acee18a5066e00b98d1c20fc677a15 (diff) | |
parent | 70e684a681352e95fb990747ef6dd7183da333a8 (diff) | |
download | rails-64e3660ff0c0fd708fd4fc5455c54bf3d511032b.tar.gz rails-64e3660ff0c0fd708fd4fc5455c54bf3d511032b.tar.bz2 rails-64e3660ff0c0fd708fd4fc5455c54bf3d511032b.zip |
Merge pull request #8818 from jamis/master
view_cache_dependency API
Diffstat (limited to 'actionpack/test/template')
-rw-r--r-- | actionpack/test/template/digestor_test.rb | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/actionpack/test/template/digestor_test.rb b/actionpack/test/template/digestor_test.rb index 02b1fd87a8..849e2981a6 100644 --- a/actionpack/test/template/digestor_test.rb +++ b/actionpack/test/template/digestor_test.rb @@ -138,6 +138,20 @@ class TemplateDigestorTest < ActionView::TestCase end end + def test_dependencies_via_options_results_in_different_digest + digest_plain = digest("comments/_comment") + digest_fridge = digest("comments/_comment", dependencies: ["fridge"]) + digest_phone = digest("comments/_comment", dependencies: ["phone"]) + digest_fridge_phone = digest("comments/_comment", dependencies: ["fridge", "phone"]) + + assert_not_equal digest_plain, digest_fridge + assert_not_equal digest_plain, digest_phone + assert_not_equal digest_plain, digest_fridge_phone + assert_not_equal digest_fridge, digest_phone + assert_not_equal digest_fridge, digest_fridge_phone + assert_not_equal digest_phone, digest_fridge_phone + end + private def assert_logged(message) old_logger = ActionView::Base.logger @@ -164,8 +178,8 @@ class TemplateDigestorTest < ActionView::TestCase ActionView::Digestor.cache.clear end - def digest(template_name) - ActionView::Digestor.digest(template_name, :html, FixtureFinder.new) + def digest(template_name, options={}) + ActionView::Digestor.digest(template_name, :html, FixtureFinder.new, options) end def change_template(template_name) |