diff options
author | Christos Zisopoulos <christos@me.com> | 2012-08-30 13:01:25 +0200 |
---|---|---|
committer | Christos Zisopoulos <christos@me.com> | 2012-08-30 13:01:25 +0200 |
commit | 21bad7445b26f62992b494804b29b74c9769e87d (patch) | |
tree | 027f066724c5888b4d6000d9b2cbeea2986c749c /actionpack/test | |
parent | 8074f3b478a110236c8e12bc0678660a9231126b (diff) | |
download | rails-21bad7445b26f62992b494804b29b74c9769e87d.tar.gz rails-21bad7445b26f62992b494804b29b74c9769e87d.tar.bz2 rails-21bad7445b26f62992b494804b29b74c9769e87d.zip |
`Digestor` ignores most whitespace when parsing `render` invocations
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/fixtures/digestor/messages/_form.html.erb | 0 | ||||
-rw-r--r-- | actionpack/test/fixtures/digestor/messages/edit.html.erb | 4 | ||||
-rw-r--r-- | actionpack/test/template/digestor_test.rb | 23 |
3 files changed, 27 insertions, 0 deletions
diff --git a/actionpack/test/fixtures/digestor/messages/_form.html.erb b/actionpack/test/fixtures/digestor/messages/_form.html.erb new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/actionpack/test/fixtures/digestor/messages/_form.html.erb diff --git a/actionpack/test/fixtures/digestor/messages/edit.html.erb b/actionpack/test/fixtures/digestor/messages/edit.html.erb new file mode 100644 index 0000000000..791654ffc9 --- /dev/null +++ b/actionpack/test/fixtures/digestor/messages/edit.html.erb @@ -0,0 +1,4 @@ +<%= render "header" %> +<%= render partial: "form" %> +<%= render @message %> +<%= render ( @message.events ) %> diff --git a/actionpack/test/template/digestor_test.rb b/actionpack/test/template/digestor_test.rb index 067ab500f5..dd9bfbca05 100644 --- a/actionpack/test/template/digestor_test.rb +++ b/actionpack/test/template/digestor_test.rb @@ -92,6 +92,29 @@ class TemplateDigestorTest < ActionView::TestCase end end + def test_extra_whitespace_in_render_partial + assert_digest_difference("messages/edit") do + change_template("messages/_form") + end + end + + def test_extra_whitespace_in_render_named_partial + assert_digest_difference("messages/edit") do + change_template("messages/_header") + end + end + + def test_extra_whitespace_in_render_record + assert_digest_difference("messages/edit") do + change_template("messages/_message") + end + end + + def test_extra_whitespace_in_render_with_parenthesis + assert_digest_difference("messages/edit") do + change_template("events/_event") + end + end private def assert_logged(message) |