From 749a745264283babcff72c8303e185d793cc6eb9 Mon Sep 17 00:00:00 2001 From: Brian Alexander Date: Fri, 21 Dec 2012 14:51:41 -0700 Subject: Digestor explicit dependency should not contain trailing whitespace test for rails/rails#8586 --- actionpack/lib/action_view/digestor.rb | 2 +- actionpack/test/fixtures/digestor/messages/show.html.erb | 6 +++++- actionpack/test/template/digestor_test.rb | 6 ++++++ 3 files changed, 12 insertions(+), 2 deletions(-) (limited to 'actionpack') diff --git a/actionpack/lib/action_view/digestor.rb b/actionpack/lib/action_view/digestor.rb index 8bc69b9246..f3f6b425a8 100644 --- a/actionpack/lib/action_view/digestor.rb +++ b/actionpack/lib/action_view/digestor.rb @@ -2,7 +2,7 @@ require 'thread_safe' module ActionView class Digestor - EXPLICIT_DEPENDENCY = /# Template Dependency: ([^ ]+)/ + EXPLICIT_DEPENDENCY = /# Template Dependency: (\S+)/ # Matches: # render partial: "comments/comment", collection: commentable.comments diff --git a/actionpack/test/fixtures/digestor/messages/show.html.erb b/actionpack/test/fixtures/digestor/messages/show.html.erb index 9f73345a9f..51b3b61e8e 100644 --- a/actionpack/test/fixtures/digestor/messages/show.html.erb +++ b/actionpack/test/fixtures/digestor/messages/show.html.erb @@ -6,4 +6,8 @@ <%= render @message.history.events %> -<%# render "something_missing" %> \ No newline at end of file +<%# render "something_missing" %> + +<% + # Template Dependency: messages/form +%> \ No newline at end of file diff --git a/actionpack/test/template/digestor_test.rb b/actionpack/test/template/digestor_test.rb index f493c8201d..02b1fd87a8 100644 --- a/actionpack/test/template/digestor_test.rb +++ b/actionpack/test/template/digestor_test.rb @@ -46,6 +46,12 @@ class TemplateDigestorTest < ActionView::TestCase end end + def test_explicit_dependency_in_multiline_erb_tag + assert_digest_difference("messages/show") do + change_template("messages/_form") + end + end + def test_second_level_dependency assert_digest_difference("messages/show") do change_template("comments/_comments") -- cgit v1.2.3