mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
stop directly setting headers on the controller
again, since we are going through the test harness, all this is done for us.
This commit is contained in:
parent
f679397634
commit
d175ab2bd6
2 changed files with 1 additions and 14 deletions
|
@ -2,11 +2,6 @@ module ActionController
|
||||||
module Testing
|
module Testing
|
||||||
extend ActiveSupport::Concern
|
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
|
# Behavior specific to functional tests
|
||||||
module Functional # :nodoc:
|
module Functional # :nodoc:
|
||||||
def set_response!(request)
|
def set_response!(request)
|
||||||
|
|
|
@ -27,7 +27,6 @@ class SendFileController < ActionController::Base
|
||||||
:filename => 'filename'
|
:filename => 'filename'
|
||||||
}
|
}
|
||||||
|
|
||||||
self.headers = {}
|
|
||||||
send_data "foo", options
|
send_data "foo", options
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -38,34 +37,27 @@ class SendFileController < ActionController::Base
|
||||||
:filename => 'filename'
|
:filename => 'filename'
|
||||||
}
|
}
|
||||||
|
|
||||||
self.headers = {}
|
|
||||||
send_data "foo", options
|
send_data "foo", options
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_send_file_headers_with_mime_lookup_with_symbol
|
def test_send_file_headers_with_mime_lookup_with_symbol
|
||||||
options = {
|
options = { :type => :png }
|
||||||
:type => :png
|
|
||||||
}
|
|
||||||
|
|
||||||
self.headers = {}
|
|
||||||
send_data "foo", options
|
send_data "foo", options
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_send_file_headers_with_bad_symbol
|
def test_send_file_headers_with_bad_symbol
|
||||||
options = { :type => :this_type_is_not_registered }
|
options = { :type => :this_type_is_not_registered }
|
||||||
self.headers = {}
|
|
||||||
send_data "foo", options
|
send_data "foo", options
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_send_file_headers_with_nil_content_type
|
def test_send_file_headers_with_nil_content_type
|
||||||
options = { :type => nil }
|
options = { :type => nil }
|
||||||
self.headers = {}
|
|
||||||
send_data "foo", options
|
send_data "foo", options
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_send_file_headers_guess_type_from_extension
|
def test_send_file_headers_guess_type_from_extension
|
||||||
options = { :filename => params[:filename] }
|
options = { :filename => params[:filename] }
|
||||||
self.headers = {}
|
|
||||||
send_data "foo", options
|
send_data "foo", options
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue