aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2016-02-17 14:36:43 +0100
committerYves Senn <yves.senn@gmail.com>2016-02-17 14:36:43 +0100
commit735e56e3ebcf31afb5968002aee7c582ea7a22f8 (patch)
tree9c2c3f3f335ce1e26df74888fdee935fdf382ac2 /actionview/test
parent39b1dd1c3da8465aa033509f13a614e16b7383ae (diff)
parentfe698bad34dbb11679c6951132bb46375b4ad8af (diff)
downloadrails-735e56e3ebcf31afb5968002aee7c582ea7a22f8.tar.gz
rails-735e56e3ebcf31afb5968002aee7c582ea7a22f8.tar.bz2
rails-735e56e3ebcf31afb5968002aee7c582ea7a22f8.zip
Merge pull request #23662 from rthbound/adds-missing-digestor-nested-deps-tests
adds missing tests for Digestor#nested_dependencies
Diffstat (limited to 'actionview/test')
-rw-r--r--actionview/test/fixtures/digestor/messages/peek.html.erb2
-rw-r--r--actionview/test/template/digestor_test.rb10
2 files changed, 12 insertions, 0 deletions
diff --git a/actionview/test/fixtures/digestor/messages/peek.html.erb b/actionview/test/fixtures/digestor/messages/peek.html.erb
new file mode 100644
index 0000000000..84885ab0bc
--- /dev/null
+++ b/actionview/test/fixtures/digestor/messages/peek.html.erb
@@ -0,0 +1,2 @@
+<%# Template Dependency: messages/message %>
+<%= render "comments/comments" %>
diff --git a/actionview/test/template/digestor_test.rb b/actionview/test/template/digestor_test.rb
index bfab97cf1e..e50caac6d8 100644
--- a/actionview/test/template/digestor_test.rb
+++ b/actionview/test/template/digestor_test.rb
@@ -130,6 +130,16 @@ class TemplateDigestorTest < ActionView::TestCase
end
end
+ def test_getting_of_singly_nested_dependencies
+ singly_nested_dependencies = ["messages/header", "messages/form", "messages/message", "events/event", "comments/comment"]
+ assert_equal singly_nested_dependencies, nested_dependencies('messages/edit')
+ end
+
+ def test_getting_of_doubly_nested_dependencies
+ doubly_nested = [{"comments/comments"=>["comments/comment"]}, "messages/message"]
+ assert_equal doubly_nested, nested_dependencies('messages/peek')
+ end
+
def test_nested_template_directory
assert_digest_difference("messages/show") do
change_template("messages/actions/_move")