Module ActionController::TestProcess
In: lib/action_controller/test_process.rb

Methods

Public Class methods

Public Instance methods

Shortcut for ActionController::TestUploadedFile.new(Test::Unit::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)

execute the request and set/volley the response

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

[Validate]