diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2009-04-28 23:19:53 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-04-28 23:19:53 -0700 |
commit | d6c584618f03f9ca6862338245b07ab87f72a672 (patch) | |
tree | 78d33afda4f0d621ad07236123cc50ab4237511a /actionpack/lib/action_controller/testing/integration.rb | |
parent | 599f2cfb4a0e0ec4135265bf5c56b83f1450beea (diff) | |
parent | c0a372ba87f556769b98a6d06e8c684c3c3156df (diff) | |
download | rails-d6c584618f03f9ca6862338245b07ab87f72a672.tar.gz rails-d6c584618f03f9ca6862338245b07ab87f72a672.tar.bz2 rails-d6c584618f03f9ca6862338245b07ab87f72a672.zip |
Merge branch 'master' of git@github.com:rails/rails
Diffstat (limited to 'actionpack/lib/action_controller/testing/integration.rb')
-rw-r--r-- | actionpack/lib/action_controller/testing/integration.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/testing/integration.rb b/actionpack/lib/action_controller/testing/integration.rb index be5f216e2b..037463e489 100644 --- a/actionpack/lib/action_controller/testing/integration.rb +++ b/actionpack/lib/action_controller/testing/integration.rb @@ -263,7 +263,6 @@ module ActionController opts = { :method => method.to_s.upcase, :params => parameters, - :headers => headers, "SERVER_NAME" => host, "SERVER_PORT" => (https? ? "443" : "80"), @@ -282,6 +281,12 @@ module ActionController } env = ActionDispatch::Test::MockRequest.env_for(@path, opts) + (headers || {}).each do |key, value| + key = key.to_s.upcase.gsub(/-/, "_") + key = "HTTP_#{key}" unless env.has_key?(key) || key =~ /^HTTP_/ + env[key] = value + end + app = Rack::Lint.new(@app) status, headers, body = app.call(env) response = ::Rack::MockResponse.new(status, headers, body) |