aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorBrian Alexander <balexand@gmail.com>2012-12-21 14:51:41 -0700
committerBrian Alexander <balexand@gmail.com>2012-12-21 18:00:51 -0700
commit749a745264283babcff72c8303e185d793cc6eb9 (patch)
treec0b0558d8f8ebb4283fe165c3fa0878bc203bb30 /actionpack
parent95f5f8167ff86550d7fa9f5f7419cc9b38ef9704 (diff)
downloadrails-749a745264283babcff72c8303e185d793cc6eb9.tar.gz
rails-749a745264283babcff72c8303e185d793cc6eb9.tar.bz2
rails-749a745264283babcff72c8303e185d793cc6eb9.zip
Digestor explicit dependency should not contain trailing whitespace
test for rails/rails#8586
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_view/digestor.rb2
-rw-r--r--actionpack/test/fixtures/digestor/messages/show.html.erb6
-rw-r--r--actionpack/test/template/digestor_test.rb6
3 files changed, 12 insertions, 2 deletions
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")