提交 d175ab2b 编写于 作者: A Aaron Patterson

stop directly setting headers on the controller

again, since we are going through the test harness, all this is done
for us.
上级 f6793976
......@@ -2,11 +2,6 @@ module ActionController
module Testing
extend ActiveSupport::Concern
# TODO : Rewrite tests using controller.headers= to use Rack env
def headers=(new_headers)
@_response.headers.replace(new_headers)
end
# Behavior specific to functional tests
module Functional # :nodoc:
def set_response!(request)
......
......@@ -27,7 +27,6 @@ def test_send_file_headers_bang
:filename => 'filename'
}
self.headers = {}
send_data "foo", options
end
......@@ -38,34 +37,27 @@ def test_send_file_headers_with_disposition_as_a_symbol
:filename => 'filename'
}
self.headers = {}
send_data "foo", options
end
def test_send_file_headers_with_mime_lookup_with_symbol
options = {
:type => :png
}
options = { :type => :png }
self.headers = {}
send_data "foo", options
end
def test_send_file_headers_with_bad_symbol
options = { :type => :this_type_is_not_registered }
self.headers = {}
send_data "foo", options
end
def test_send_file_headers_with_nil_content_type
options = { :type => nil }
self.headers = {}
send_data "foo", options
end
def test_send_file_headers_guess_type_from_extension
options = { :filename => params[:filename] }
self.headers = {}
send_data "foo", options
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册