提交 3c516c4b 编写于 作者: B Bryan Ricker

Allow numbers in partial name for digesting

Add failing test for template with number at the end

Use \w for RENDER_DEPENDENCY regex

Spacing

Add CHANGELOG entry
上级 17c1143a
* No changes. * Fix an issue where partials with a number in the filename weren't being digested for cache dependencies.
*Bryan Ricker*
Please check [4-0-stable](https://github.com/rails/rails/blob/4-0-stable/actionpack/CHANGELOG.md) for previous changes. Please check [4-0-stable](https://github.com/rails/rails/blob/4-0-stable/actionpack/CHANGELOG.md) for previous changes.
...@@ -39,7 +39,7 @@ class ERBTracker ...@@ -39,7 +39,7 @@ class ERBTracker
render\s* # render, followed by optional whitespace render\s* # render, followed by optional whitespace
\(? # start an optional parenthesis for the render call \(? # start an optional parenthesis for the render call
(partial:|:partial\s+=>)?\s* # naming the partial, used with collection -- 1st capture (partial:|:partial\s+=>)?\s* # naming the partial, used with collection -- 1st capture
([@a-z"'][@a-z_\/\."']+) # the template name itself -- 2nd capture ([@a-z"'][@\w\/\."']+) # the template name itself -- 2nd capture
/x /x
def self.call(name, template) def self.call(name, template)
......
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
<%= render @message.history.events %> <%= render @message.history.events %>
<%# render "something_missing" %> <%# render "something_missing" %>
<%# render "something_missing_1" %>
<% <%
# Template Dependency: messages/form # Template Dependency: messages/form
%> %>
\ No newline at end of file
...@@ -83,6 +83,12 @@ def test_logging_of_missing_template ...@@ -83,6 +83,12 @@ def test_logging_of_missing_template
end end
end end
def test_logging_of_missing_template_ending_with_number
assert_logged "Couldn't find template for digesting: messages/something_missing_1.html" do
digest("messages/show")
end
end
def test_nested_template_directory def test_nested_template_directory
assert_digest_difference("messages/show") do assert_digest_difference("messages/show") do
change_template("messages/actions/_move") change_template("messages/actions/_move")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册