diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-04-30 17:26:03 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-04-30 17:26:03 -0500 |
commit | 00d1a57e9f99a1b2439281cb741fd82ef47a5c55 (patch) | |
tree | 3fafedd0ef5870df4c8d603aab7dadf3f833a977 /actionpack/lib/action_dispatch/http/response.rb | |
parent | 64e66cf161ee8db0bdbccb1be18fb760f5a9d24e (diff) | |
download | rails-00d1a57e9f99a1b2439281cb741fd82ef47a5c55.tar.gz rails-00d1a57e9f99a1b2439281cb741fd82ef47a5c55.tar.bz2 rails-00d1a57e9f99a1b2439281cb741fd82ef47a5c55.zip |
Start moving TestRequest and TestResponse into ActionDispatch
Diffstat (limited to 'actionpack/lib/action_dispatch/http/response.rb')
-rw-r--r-- | actionpack/lib/action_dispatch/http/response.rb | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/actionpack/lib/action_dispatch/http/response.rb b/actionpack/lib/action_dispatch/http/response.rb index 1b12308cc9..2b969323ca 100644 --- a/actionpack/lib/action_dispatch/http/response.rb +++ b/actionpack/lib/action_dispatch/http/response.rb @@ -31,14 +31,6 @@ module ActionDispatch # :nodoc: # end # end class Response < Rack::Response - def self.from_response(response) - new.tap do |resp| - resp.status = response.status - resp.headers = response.headers - resp.body = response.body - end - end - DEFAULT_HEADERS = { "Cache-Control" => "no-cache" } attr_accessor :request @@ -47,27 +39,6 @@ module ActionDispatch # :nodoc: attr_writer :header alias_method :headers=, :header= - def template - ActiveSupport::Deprecation.warn("response.template has been deprecated. Use controller.template instead", caller) - @template - end - attr_writer :template - - def session - ActiveSupport::Deprecation.warn("response.session has been deprecated. Use request.session instead", caller) - @request.session - end - - def assigns - ActiveSupport::Deprecation.warn("response.assigns has been deprecated. Use controller.assigns instead", caller) - @template.controller.assigns - end - - def layout - ActiveSupport::Deprecation.warn("response.layout has been deprecated. Use template.layout instead", caller) - @template.layout - end - delegate :default_charset, :to => 'ActionController::Base' def initialize @@ -90,33 +61,6 @@ module ActionDispatch # :nodoc: end alias_method :status_message, :message - # Was the response successful? - def success? - (200..299).include?(response_code) - end - - # Was the URL not found? - def missing? - response_code == 404 - end - - # Were we redirected? - def redirect? - (300..399).include?(response_code) - end - - # Was there a server-side error? - def error? - (500..599).include?(response_code) - end - - alias_method :server_error?, :error? - - # Was there a client client? - def client_error? - (400..499).include?(response_code) - end - def body str = '' each { |part| str << part.to_s } |