From d63b42da362d696398fd371815734cb0caed48df Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Tue, 28 Apr 2009 16:25:04 -0500 Subject: Move header injection back into integration tests --- actionpack/lib/action_controller/testing/integration.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'actionpack/lib/action_controller/testing') 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) -- cgit v1.2.3