process
- 1.0.0
- 1.1.6
- 1.2.6
- 2.0.3
- 2.1.0
- 2.2.1
- 2.3.8
- 3.0.0 (0)
- 3.0.9 (0)
- 3.1.0 (0)
- 3.2.1 (0)
- 3.2.8 (0)
- 3.2.13 (0)
- 4.0.2 (0)
- 4.1.8 (0)
- 4.2.1 (38)
- 4.2.7 (0)
- 4.2.9 (0)
- 5.0.0.1
- 5.1.7 (7)
- 5.2.3 (0)
- 6.0.0 (0)
- 6.1.3.1 (0)
- 6.1.7.7 (0)
- 7.0.0 (10)
- 7.1.3.2 (0)
- 7.1.3.4 (0)
- What's this?
process(action, http_method = 'GET', *args)
public
Simulate a HTTP request to action by specifying request method, parameters and set/volley the response.
-
action: The controller action to call.
-
http_method: Request method used to send the http request. Possible values are GET, POST, PATCH, PUT, DELETE, HEAD. Defaults to GET.
-
parameters: The HTTP parameters. This may be nil, a hash, or a string that is appropriately encoded (application/x-www-form-urlencoded or multipart/form-data).
-
session: A hash of parameters to store in the session. This may be nil.
-
flash: A hash of parameters to store in the flash. This may be nil.
Example calling create action and sending two params:
process :create, 'POST', user: { name: 'Gaurish Sharma', email: 'user@example.com' }
Example sending parameters, nil session and setting a flash message:
process :view, 'GET', { id: 7 }, nil, { notice: 'This is flash message' }
To simulate GET, POST, PATCH, PUT, DELETE and HEAD requests prefer using #get, #post, #patch, #put, #delete and #head methods respectively which will make tests more expressive.
Note that the request method is not verified.