Module: Merb::Test::MultipartRequestHelper

Module | Merb::Test::MultipartRequestHelper
In: | lib/merb-core/test/helpers/multipart_request_helper.rb lib/merb-core/two-oh.rb

### Methods

dispatch_multipart_to multipart_fake_request multipart_post multipart_post multipart_put multipart_put multipart_request

### Classes and Modules

Class Merb::Test::MultipartRequestHelper::FileParam
Class Merb::Test::MultipartRequestHelper::Param
Class Merb::Test::MultipartRequestHelper::Post

### Public Instance methods

dispatch_multipart_to(controller_klass, action, params = {}, env = {}, &blk)

Similar to dispatch_to but allows for sending files inside params.

#### Paramters

controller_klass<Controller>: | The controller class object that the action should be dispatched to.
action<Symbol>: | The action name, as a symbol.
params<Hash>: | An optional hash that will end up as params in the controller instance.
env<Hash>: | An optional hash that is passed to the fake request. Any request options should go here (see `fake_request`).
&blk: | The block is executed in the context of the controller.

#### Example

      dispatch_multipart_to(MyController, :create, :my_file => @a_file ) do |controller|
        controller.stub!(:current_user).and_return(@user)
      end

#### Notes

Set your option to contain a file object to simulate file uploads.

Does not use routes.

multipart_fake_request(env = {}, params = {})

#### Parameters

env<Hash>: | An optional hash that is passed to the fake request. Any request options should go here (see `fake_request`).
params<Hash>: | An optional hash that will end up as params in the controller instance.

#### Returns

FakeRequest: | A multipart Request object that is built based on the parameters.

multipart_post(path, params = {}, env = {})

An HTTP POST request that operates through the router and uses multipart parameters.

#### Parameters

path<String>: | The path that should go to the router as the request uri.
params<Hash>: | An optional hash that will end up as params in the controller instance.
env<Hash>: | An optional hash that is passed to the fake request. Any request options should go here (see `fake_request`).
block<Proc>: | The block is executed in the context of the controller.

#### Notes

To include an uploaded file, put a file object as a value in params.

multipart_post(path, params = {}, env = {}, &block)

An HTTP POST request that operates through the router and uses multipart parameters.

#### Parameters

path<String>: | The path that should go to the router as the request uri.
params<Hash>: | An optional hash that will end up as params in the controller instance.
env<Hash>: | An optional hash that is passed to the fake request. Any request options should go here (see `fake_request`).
block<Proc>: | The block is executed in the context of the controller.

#### Notes

To include an uploaded file, put a file object as a value in params.

multipart_put(path, params = {}, env = {}, &block)

An HTTP PUT request that operates through the router and uses multipart parameters.

#### Parameters

path<String>: | The path that should go to the router as the request uri.
params<Hash>: | An optional hash that will end up as params in the controller instance.
env<Hash>: | An optional hash that is passed to the fake request. Any request options should go here (see `fake_request`).
block<Proc>: | The block is executed in the context of the controller.

#### Notes

To include an uplaoded file, put a file object as a value in params.

multipart_put(path, params = {}, env = {}, &block)

An HTTP PUT request that operates through the router and uses multipart parameters.

#### Parameters

path<String>: | The path that should go to the router as the request uri.
params<Hash>: | An optional hash that will end up as params in the controller instance.
env<Hash>: | An optional hash that is passed to the fake request. Any request options should go here (see `fake_request`).
block<Proc>: | The block is executed in the context of the controller.

#### Notes

To include an uplaoded file, put a file object as a value in params.

multipart_request(path, params = {}, env = {})

[Validate]