diff options
author | João Britto <jabcalves@gmail.com> | 2013-12-21 22:14:07 -0200 |
---|---|---|
committer | João Britto <jabcalves@gmail.com> | 2014-01-09 20:37:00 -0200 |
commit | ccbba3ff50a7c2d6523f55f7821aabdb89fc5d45 (patch) | |
tree | ad9eb5a6d62d3b551b0f7fbb804412958cbdabc9 /actionview/test | |
parent | c2afa055614f15edfbd2f4c97f9254425286fc6e (diff) | |
download | rails-ccbba3ff50a7c2d6523f55f7821aabdb89fc5d45.tar.gz rails-ccbba3ff50a7c2d6523f55f7821aabdb89fc5d45.tar.bz2 rails-ccbba3ff50a7c2d6523f55f7821aabdb89fc5d45.zip |
Avoid scanning multiple render calls as a single match.
Each chunk of text coming after `render` is now handled individually as a possible list of arguments.
Diffstat (limited to 'actionview/test')
-rw-r--r-- | actionview/test/template/dependency_tracker_test.rb | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/actionview/test/template/dependency_tracker_test.rb b/actionview/test/template/dependency_tracker_test.rb index 6540394c14..df3a0602d1 100644 --- a/actionview/test/template/dependency_tracker_test.rb +++ b/actionview/test/template/dependency_tracker_test.rb @@ -147,12 +147,34 @@ class ERBTrackerTest < Minitest::Test end def test_finds_dependencies_with_quotes_within - template = FakeTemplate.new(" - <%# render \"single/quote's\" %> - <%# render 'double/quote\"s' %> - ", :erb) + template = FakeTemplate.new(%{ + <%# render "single/quote's" %> + <%# render 'double/quote"s' %> + }, :erb) + tracker = make_tracker("quotes/_single_and_double", template) assert_equal ["single/quote's", 'double/quote"s'], tracker.dependencies end + + def test_finds_dependencies_with_extra_spaces + template = FakeTemplate.new(%{ + <%= render "header" %> + <%= render partial: "form" %> + <%= render @message %> + <%= render ( @message.events ) %> + <%= render :collection => @message.comments, + :partial => "comments/comment" %> + }, :erb) + + tracker = make_tracker("spaces/_extra", template) + + assert_equal [ + "spaces/header", + "spaces/form", + "messages/message", + "events/event", + "comments/comment" + ], tracker.dependencies + end end |