Module

ActionController::TestProcess

Inheritance
Included Modules
ProcessWithTest

Methods

Class

Visibility Signature
public included (base)

Instance

Visibility Signature
public assigns (key = nil)
public build_request_uri (action, parameters)
public cookies ()
public delete (action, parameters = nil, session = nil, flash = nil)
public find_all_tag (conditions)
public find_tag (conditions)
public fixture_file_upload (path, mime_type = nil, binary = false)
public flash ()
public get (action, parameters = nil, session = nil, flash = nil)
public head (action, parameters = nil, session = nil, flash = nil)
public html_document ()
public method_missing (selector, *args, &block)
public post (action, parameters = nil, session = nil, flash = nil)
public process (action, parameters = nil, session = nil, flash = nil, http_method = 'GET')
public put (action, parameters = nil, session = nil, flash = nil)
public redirect_to_url ()
public session ()
public with_routing () {|temporary_routes| ...}
public xhr (request_method, action, parameters = nil, session = nil, flash = nil)
public xml_http_request (request_method, action, parameters = nil, session = nil, flash = nil)

Class Method Detail

included(base)

Instance Method Detail

assigns(key = nil)

build_request_uri(action, parameters)

cookies()

delete(action, parameters = nil, session = nil, flash = nil)

Executes a request simulating DELETE HTTP method and set/volley the response

find_all_tag(conditions)

find_tag(conditions)

fixture_file_upload(path, mime_type = nil, binary = false)

Shortcut for ActionController::TestUploadedFile.new(ActionController::TestCase.fixture_path + path, type):

  post :change_avatar, :avatar => fixture_file_upload('/files/spongebob.png', 'image/png')

To upload binary files on Windows, pass :binary as the last parameter. This will not affect other platforms:

  post :change_avatar, :avatar => fixture_file_upload('/files/spongebob.png', 'image/png', :binary)

flash()

get(action, parameters = nil, session = nil, flash = nil)

Executes a request simulating GET HTTP method and set/volley the response

head(action, parameters = nil, session = nil, flash = nil)

Executes a request simulating HEAD HTTP method and set/volley the response

html_document()

method_missing(selector, *args, &block)

post(action, parameters = nil, session = nil, flash = nil)

Executes a request simulating POST HTTP method and set/volley the response

process(action, parameters = nil, session = nil, flash = nil, http_method = 'GET')

put(action, parameters = nil, session = nil, flash = nil)

Executes a request simulating PUT HTTP method and set/volley the response

redirect_to_url()

session()

with_routing() {|temporary_routes| ...}

A helper to make it easier to test different route configurations. This method temporarily replaces ActionController::Routing::Routes with a new RouteSet instance.

The new instance is yielded to the passed block. Typically the block will create some routes using map.draw { map.connect … }:

  with_routing do |set|
    set.draw do |map|
      map.connect ':controller/:action/:id'
        assert_equal(
          ['/content/10/show', {}],
          map.generate(:controller => 'content', :id => 10, :action => 'show')
      end
    end
  end

xhr(request_method, action, parameters = nil, session = nil, flash = nil)

Alias for xml_http_request

xml_http_request(request_method, action, parameters = nil, session = nil, flash = nil)