aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/test_case.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2015-09-04 17:36:15 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2015-09-04 17:37:22 -0700
commit529136d670c46bd66b56c519d4f51ed8f86c75b1 (patch)
tree2888e7d0f8fb8a58184dd520816def1ba08e9e13 /actionpack/lib/action_controller/test_case.rb
parent3f24fa338ffb63e3f25d1c72f0dc65665fd97cec (diff)
downloadrails-529136d670c46bd66b56c519d4f51ed8f86c75b1.tar.gz
rails-529136d670c46bd66b56c519d4f51ed8f86c75b1.tar.bz2
rails-529136d670c46bd66b56c519d4f51ed8f86c75b1.zip
stop inheriting from Rack::Request
Just include the modules necessary in the Request object to implement the things we need. This should make it easier to build delegate request objects because the API is smaller
Diffstat (limited to 'actionpack/lib/action_controller/test_case.rb')
-rw-r--r--actionpack/lib/action_controller/test_case.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb
index ebb4ebdd46..d84f5737a8 100644
--- a/actionpack/lib/action_controller/test_case.rb
+++ b/actionpack/lib/action_controller/test_case.rb
@@ -70,7 +70,7 @@ module ActionController
self.content_type = ENCODER.content_type
data = ENCODER.build_multipart non_path_parameters
else
- get_header('CONTENT_TYPE') do |k|
+ fetch_header('CONTENT_TYPE') do |k|
set_header k, 'application/x-www-form-urlencoded'
end
@@ -98,7 +98,7 @@ module ActionController
set_header 'rack.input', StringIO.new(data)
end
- get_header("PATH_INFO") do |k|
+ fetch_header("PATH_INFO") do |k|
set_header k, generated_path
end
path_parameters[:controller] = controller_path
@@ -500,7 +500,7 @@ module ActionController
if xhr
@request.set_header 'HTTP_X_REQUESTED_WITH', 'XMLHttpRequest'
- @request.get_header('HTTP_ACCEPT') do |k|
+ @request.fetch_header('HTTP_ACCEPT') do |k|
@request.set_header k, [Mime::JS, Mime::HTML, Mime::XML, 'text/xml', Mime::ALL].join(', ')
end
end
@@ -508,7 +508,7 @@ module ActionController
@controller.request = @request
@controller.response = @response
- @request.get_header("SCRIPT_NAME") do |k|
+ @request.fetch_header("SCRIPT_NAME") do |k|
@request.set_header k, @controller.config.relative_url_root
end