Module: ActionController::Testing

Extended by:
ActiveSupport::Concern
Includes:
RackDelegation
Defined in:
lib/action_controller/metal/testing.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Methods included from RackDelegation

#dispatch, #reset_session, #response_body=

Instance Method Details

#headers=(new_headers) ⇒ Object

TODO : Rewrite tests using controller.headers= to use Rack env


26
27
28
29
# File 'lib/action_controller/metal/testing.rb', line 26

def headers=(new_headers)
  @_response ||= ActionDispatch::Response.new
  @_response.headers.replace(new_headers)
end

#process_with_new_base_test(request, response) ⇒ Object

TODO: Clean this up


13
14
15
16
17
18
19
20
21
22
23
# File 'lib/action_controller/metal/testing.rb', line 13

def process_with_new_base_test(request, response)
  @_request = request
  @_response = response
  @_response.request = request
  ret = process(request.parameters[:action])
  if cookies = @_request.env['action_dispatch.cookies']
    cookies.write(@_response)
  end
  @_response.prepare!
  ret
end

#recycle!Object


7
8
9
# File 'lib/action_controller/metal/testing.rb', line 7

def recycle!
  @_url_options = nil
end