aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/abstract_controller/abstract_controller_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/abstract_controller/abstract_controller_test.rb')
-rw-r--r--actionpack/test/abstract_controller/abstract_controller_test.rb22
1 files changed, 20 insertions, 2 deletions
diff --git a/actionpack/test/abstract_controller/abstract_controller_test.rb b/actionpack/test/abstract_controller/abstract_controller_test.rb
index 6d33888821..918062c7db 100644
--- a/actionpack/test/abstract_controller/abstract_controller_test.rb
+++ b/actionpack/test/abstract_controller/abstract_controller_test.rb
@@ -56,6 +56,14 @@ module AbstractController
def naked_render
render
end
+
+ def rendering_to_body
+ render_to_body "naked_render.erb"
+ end
+
+ def rendering_to_string
+ render_to_string "naked_render.erb"
+ end
end
class TestRenderer < ActiveSupport::TestCase
@@ -73,6 +81,16 @@ module AbstractController
result = Me2.process(:naked_render)
assert_equal "Hello from naked_render.erb", result.response_obj[:body]
end
+
+ test "rendering to a rack body" do
+ result = Me2.process(:rendering_to_body)
+ assert_equal "Hello from naked_render.erb", result.response_obj[:body]
+ end
+
+ test "rendering to a string" do
+ result = Me2.process(:rendering_to_string)
+ assert_equal "Hello from naked_render.erb", result.response_obj[:body]
+ end
end
# Test rendering with prefixes
@@ -134,7 +152,7 @@ module AbstractController
self.class.layout(formats)
end
- def render_to_string(options = {})
+ def render_to_body(options = {})
options[:_layout] = options[:layout] || _layout
super
end
@@ -223,4 +241,4 @@ module AbstractController
end
end
-end \ No newline at end of file
+end