aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorwycats <wycats@gmail.com>2010-04-04 19:49:12 -0700
committerwycats <wycats@gmail.com>2010-04-04 19:58:15 -0700
commit209fb5190b1415633fcd42f7617ff5001669dd27 (patch)
tree57ef13a867e090a6b34eb7f10ffd027968b43ea5 /actionpack/test
parent723e91e9fd594856aa7bcd38b04d04acd03039be (diff)
downloadrails-209fb5190b1415633fcd42f7617ff5001669dd27.tar.gz
rails-209fb5190b1415633fcd42f7617ff5001669dd27.tar.bz2
rails-209fb5190b1415633fcd42f7617ff5001669dd27.zip
render_to_string should have the identical signature as render
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/abstract/abstract_controller_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/test/abstract/abstract_controller_test.rb b/actionpack/test/abstract/abstract_controller_test.rb
index f70d497481..5a0a2aef10 100644
--- a/actionpack/test/abstract/abstract_controller_test.rb
+++ b/actionpack/test/abstract/abstract_controller_test.rb
@@ -49,6 +49,11 @@ module AbstractController
render "index.erb"
end
+
+ def index_to_string
+ self.response_body = render_to_string "index.erb"
+ end
+
def action_with_ivars
@my_ivar = "Hello"
render "action_with_ivars.erb"
@@ -77,6 +82,11 @@ module AbstractController
assert_equal "Hello from index.erb", @controller.response_body
end
+ test "render_to_string works with a String as an argument" do
+ @controller.process(:index_to_string)
+ assert_equal "Hello from index.erb", @controller.response_body
+ end
+
test "rendering passes ivars to the view" do
@controller.process(:action_with_ivars)
assert_equal "Hello from index_with_ivars.erb", @controller.response_body