diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2014-05-28 11:39:11 -0300 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2014-05-28 11:39:11 -0300 |
commit | c711c90bae821a57523d99b526b22e84a1562ead (patch) | |
tree | 0de930e4d734a2a49ddbfff96c71c6dca67188ce /actionpack/test/controller/render_other_test.rb | |
parent | b22b1882238b08ed341bebc32335b6b6f6f64dfb (diff) | |
parent | 2ba945253bffb1e6a55ded601d62c95a6acde4a1 (diff) | |
download | rails-c711c90bae821a57523d99b526b22e84a1562ead.tar.gz rails-c711c90bae821a57523d99b526b22e84a1562ead.tar.bz2 rails-c711c90bae821a57523d99b526b22e84a1562ead.zip |
Merge pull request #15385 from zuhao/refactor_actionpack_render_other_test
Add and remove renderer inside the test to prevent leak.
Diffstat (limited to 'actionpack/test/controller/render_other_test.rb')
-rw-r--r-- | actionpack/test/controller/render_other_test.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/actionpack/test/controller/render_other_test.rb b/actionpack/test/controller/render_other_test.rb index b5e74e373d..af50e11261 100644 --- a/actionpack/test/controller/render_other_test.rb +++ b/actionpack/test/controller/render_other_test.rb @@ -1,9 +1,5 @@ require 'abstract_unit' -ActionController.add_renderer :simon do |says, options| - self.content_type = Mime::TEXT - self.response_body = "Simon says: #{says}" -end class RenderOtherTest < ActionController::TestCase class TestController < ActionController::Base @@ -15,7 +11,14 @@ class RenderOtherTest < ActionController::TestCase tests TestController def test_using_custom_render_option + ActionController.add_renderer :simon do |says, options| + self.content_type = Mime::TEXT + self.response_body = "Simon says: #{says}" + end + get :render_simon_says assert_equal "Simon says: foo", @response.body + ensure + ActionController.remove_renderer :simon end end |