aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template/dependency_tracker_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionview/test/template/dependency_tracker_test.rb')
-rw-r--r--actionview/test/template/dependency_tracker_test.rb16
1 files changed, 15 insertions, 1 deletions
diff --git a/actionview/test/template/dependency_tracker_test.rb b/actionview/test/template/dependency_tracker_test.rb
index df3a0602d1..672b4747ec 100644
--- a/actionview/test/template/dependency_tracker_test.rb
+++ b/actionview/test/template/dependency_tracker_test.rb
@@ -1,4 +1,3 @@
-# encoding: utf-8
require 'abstract_unit'
require 'action_view/dependency_tracker'
@@ -31,6 +30,7 @@ class DependencyTrackerTest < ActionView::TestCase
end
def teardown
+ ActionView::Template.unregister_template_handler :neckbeard
tracker.remove_tracker(:neckbeard)
end
@@ -59,6 +59,20 @@ class ERBTrackerTest < Minitest::Test
assert_equal ["messages/message123"], tracker.dependencies
end
+ def test_dependency_of_template_partial_with_layout
+ template = FakeTemplate.new("<%# render partial: 'messages/show', layout: 'messages/layout' %>", :erb)
+ tracker = make_tracker("multiple/_dependencies", template)
+
+ assert_equal ["messages/layout", "messages/show"], tracker.dependencies
+ end
+
+ def test_dependency_of_template_layout_standalone
+ template = FakeTemplate.new("<%# render layout: 'messages/layout' do %>", :erb)
+ tracker = make_tracker("messages/layout", template)
+
+ assert_equal ["messages/layout"], tracker.dependencies
+ end
+
def test_finds_dependency_in_correct_directory
template = FakeTemplate.new("<%# render(message.topic) %>", :erb)
tracker = make_tracker("messages/_message", template)