aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorJon Kessler <jwkpiano1@gmail.com>2013-08-16 08:22:08 -0700
committerJon Kessler <jwkpiano1@gmail.com>2013-08-16 08:22:08 -0700
commitba5fab4c015366e355ab92371b27e77e896124a4 (patch)
treee5c5ec22f53168417734e3e715faa2e12f6fbb61 /actionpack
parent5c6e11d6b89444eefcb12e24d5419dadefdea1ba (diff)
downloadrails-ba5fab4c015366e355ab92371b27e77e896124a4.tar.gz
rails-ba5fab4c015366e355ab92371b27e77e896124a4.tar.bz2
rails-ba5fab4c015366e355ab92371b27e77e896124a4.zip
update Rails::Railtie::Configuration and ActionDispatch::Response#respond_to? to accept include_private argument
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_dispatch/http/response.rb2
-rw-r--r--actionpack/test/dispatch/response_test.rb5
2 files changed, 6 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/http/response.rb b/actionpack/lib/action_dispatch/http/response.rb
index d3696cbb8a..cf10190bd1 100644
--- a/actionpack/lib/action_dispatch/http/response.rb
+++ b/actionpack/lib/action_dispatch/http/response.rb
@@ -181,7 +181,7 @@ module ActionDispatch # :nodoc:
end
alias_method :status_message, :message
- def respond_to?(method)
+ def respond_to?(method, include_private = false)
if method.to_s == 'to_path'
stream.respond_to?(:to_path)
else
diff --git a/actionpack/test/dispatch/response_test.rb b/actionpack/test/dispatch/response_test.rb
index 2fbe7358f9..4501ea095c 100644
--- a/actionpack/test/dispatch/response_test.rb
+++ b/actionpack/test/dispatch/response_test.rb
@@ -212,6 +212,11 @@ class ResponseTest < ActiveSupport::TestCase
ActionDispatch::Response.default_headers = nil
end
end
+
+ test "respond_to? accepts include_private" do
+ assert_not @response.respond_to?(:method_missing)
+ assert @response.respond_to?(:method_missing, true)
+ end
end
class ResponseIntegrationTest < ActionDispatch::IntegrationTest