From 3cb7fe590f2b3cf29c2a32504fb4d24a79559a0b Mon Sep 17 00:00:00 2001 From: Lisa Ugray Date: Fri, 14 Jul 2017 13:37:31 -0400 Subject: Delegate respond_to? in ActionView::Helpers::ControllerHelper Since methods defined in the controller helper are mostly delegated to the controller, delegate respond_to? as well, so that for example `respond_to?(:params)` behaves as expected. --- actionview/test/template/controller_helper_test.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'actionview/test/template') diff --git a/actionview/test/template/controller_helper_test.rb b/actionview/test/template/controller_helper_test.rb index 8dd0cedb75..ea0e790d9b 100644 --- a/actionview/test/template/controller_helper_test.rb +++ b/actionview/test/template/controller_helper_test.rb @@ -18,4 +18,15 @@ class ControllerHelperTest < ActionView::TestCase assert_nil default_form_builder end + + def test_respond_to + @controller = OpenStruct.new + assign_controller(@controller) + assert_not respond_to?(:params) + assert respond_to?(:assign_controller) + + @controller.params = {} + assert respond_to?(:params) + assert respond_to?(:assign_controller) + end end -- cgit v1.2.3