diff options
author | Jon Moss <me@jonathanmoss.me> | 2016-04-20 19:47:16 -0400 |
---|---|---|
committer | Jon Moss <me@jonathanmoss.me> | 2016-04-20 19:47:16 -0400 |
commit | 7bd2f9177342c57a81880425ab134945aea6fbd9 (patch) | |
tree | cce2c3d9891763a4cdfd3fd0b5e63c152e7eede9 /actionpack/test/controller | |
parent | 115efeb036d4d56186ba7b0b64750cdc57471b59 (diff) | |
download | rails-7bd2f9177342c57a81880425ab134945aea6fbd9.tar.gz rails-7bd2f9177342c57a81880425ab134945aea6fbd9.tar.bz2 rails-7bd2f9177342c57a81880425ab134945aea6fbd9.zip |
Fix ApplicationController.renderer.defaults.merge!
Previously, users were trying to modify a frozen Hash. Includes a
regression test :)
Fixes #22975
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/renderer_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/actionpack/test/controller/renderer_test.rb b/actionpack/test/controller/renderer_test.rb index 16d24fa82a..372c09bc23 100644 --- a/actionpack/test/controller/renderer_test.rb +++ b/actionpack/test/controller/renderer_test.rb @@ -87,6 +87,14 @@ class RendererTest < ActiveSupport::TestCase assert_equal "<p>1\n<br />2</p>", render[inline: '<%= simple_format "1\n2" %>'] end + test 'rendering with user specified defaults' do + ApplicationController.renderer.defaults.merge!({ hello: 'hello', https: true }) + renderer = ApplicationController.renderer.new + content = renderer.render inline: '<%= request.ssl? %>' + + assert_equal 'true', content + end + private def render @render ||= ApplicationController.renderer.method(:render) |