1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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
This commit is contained in:
Bryan Ricker 2013-04-29 15:42:16 -07:00
parent 17c1143af9
commit 3c516c4b52
4 changed files with 12 additions and 3 deletions

View file

@ -1,3 +1,5 @@
* 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.

View file

@ -39,7 +39,7 @@ module ActionView
render\s* # render, followed by optional whitespace
\(? # start an optional parenthesis for the render call
(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
def self.call(name, template)

View file

@ -7,7 +7,8 @@
<%= render @message.history.events %>
<%# render "something_missing" %>
<%# render "something_missing_1" %>
<%
# Template Dependency: messages/form
%>
%>

View file

@ -83,6 +83,12 @@ class TemplateDigestorTest < ActionView::TestCase
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
assert_digest_difference("messages/show") do
change_template("messages/actions/_move")