aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/testing/test_request.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_dispatch/testing/test_request.rb')
-rw-r--r--actionpack/lib/action_dispatch/testing/test_request.rb34
1 files changed, 17 insertions, 17 deletions
diff --git a/actionpack/lib/action_dispatch/testing/test_request.rb b/actionpack/lib/action_dispatch/testing/test_request.rb
index 46523a8600..d0beb72a41 100644
--- a/actionpack/lib/action_dispatch/testing/test_request.rb
+++ b/actionpack/lib/action_dispatch/testing/test_request.rb
@@ -1,12 +1,12 @@
-require 'active_support/core_ext/hash/indifferent_access'
-require 'rack/utils'
+require "active_support/core_ext/hash/indifferent_access"
+require "rack/utils"
module ActionDispatch
class TestRequest < Request
- DEFAULT_ENV = Rack::MockRequest.env_for('/',
- 'HTTP_HOST' => 'test.host',
- 'REMOTE_ADDR' => '0.0.0.0',
- 'HTTP_USER_AGENT' => 'Rails Testing',
+ DEFAULT_ENV = Rack::MockRequest.env_for("/",
+ "HTTP_HOST" => "test.host",
+ "REMOTE_ADDR" => "0.0.0.0",
+ "HTTP_USER_AGENT" => "Rails Testing",
)
# Create a new test request with default `env` values
@@ -22,23 +22,23 @@ module ActionDispatch
private_class_method :default_env
def request_method=(method)
- set_header('REQUEST_METHOD', method.to_s.upcase)
+ set_header("REQUEST_METHOD", method.to_s.upcase)
end
def host=(host)
- set_header('HTTP_HOST', host)
+ set_header("HTTP_HOST", host)
end
def port=(number)
- set_header('SERVER_PORT', number.to_i)
+ set_header("SERVER_PORT", number.to_i)
end
def request_uri=(uri)
- set_header('REQUEST_URI', uri)
+ set_header("REQUEST_URI", uri)
end
def path=(path)
- set_header('PATH_INFO', path)
+ set_header("PATH_INFO", path)
end
def action=(action_name)
@@ -46,24 +46,24 @@ module ActionDispatch
end
def if_modified_since=(last_modified)
- set_header('HTTP_IF_MODIFIED_SINCE', last_modified)
+ set_header("HTTP_IF_MODIFIED_SINCE", last_modified)
end
def if_none_match=(etag)
- set_header('HTTP_IF_NONE_MATCH', etag)
+ set_header("HTTP_IF_NONE_MATCH", etag)
end
def remote_addr=(addr)
- set_header('REMOTE_ADDR', addr)
+ set_header("REMOTE_ADDR", addr)
end
def user_agent=(user_agent)
- set_header('HTTP_USER_AGENT', user_agent)
+ set_header("HTTP_USER_AGENT", user_agent)
end
def accept=(mime_types)
- delete_header('action_dispatch.request.accepts')
- set_header('HTTP_ACCEPT', Array(mime_types).collect(&:to_s).join(","))
+ delete_header("action_dispatch.request.accepts")
+ set_header("HTTP_ACCEPT", Array(mime_types).collect(&:to_s).join(","))
end
end
end