aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-09-14 17:11:04 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2014-09-14 17:11:13 -0700
commit8a47e872671a331bda634ee8e9f886b8089a8754 (patch)
tree4cdef402e18a8b1574ccb5dffec3ac9d81f1e46e /actionview/test/template
parentac941096bf31a5e0957ba78df5768ec4b2014822 (diff)
downloadrails-8a47e872671a331bda634ee8e9f886b8089a8754.tar.gz
rails-8a47e872671a331bda634ee8e9f886b8089a8754.tar.bz2
rails-8a47e872671a331bda634ee8e9f886b8089a8754.zip
handle <%== nil %> cases
This is much less common than string literal appends, so add a special case method for it. Maybe fixes bug reported by @jeremy on 97ef636191933f1d4abc92fc10871e6d1195285c
Diffstat (limited to 'actionview/test/template')
-rw-r--r--actionview/test/template/compiled_templates_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/actionview/test/template/compiled_templates_test.rb b/actionview/test/template/compiled_templates_test.rb
index b84aca6746..f6c1283b92 100644
--- a/actionview/test/template/compiled_templates_test.rb
+++ b/actionview/test/template/compiled_templates_test.rb
@@ -5,6 +5,10 @@ class CompiledTemplatesTest < ActiveSupport::TestCase
ActionView::LookupContext::DetailsKey.clear
end
+ def test_template_with_nil_erb_return
+ assert_equal "This is nil: \n", render(:template => "test/nil_return")
+ end
+
def test_template_gets_recompiled_when_using_different_keys_in_local_assigns
assert_equal "one", render(:file => "test/render_file_with_locals_and_default")
assert_equal "two", render(:file => "test/render_file_with_locals_and_default", :locals => { :secret => "two" })