From 9b2b36fadbe05c395d6d8f51c247e51cb8766d0f Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Sun, 4 May 2014 11:15:40 -0300 Subject: Fix examples indent and improve #process docs a bit [ci skip] --- actionpack/lib/action_controller/test_case.rb | 30 +++++++++++++-------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb index e958cfecdf..c6a8f581de 100644 --- a/actionpack/lib/action_controller/test_case.rb +++ b/actionpack/lib/action_controller/test_case.rb @@ -554,27 +554,25 @@ module ActionController # parameters and set/volley the response. # # - +action+: The controller action to call. - # - +http_method+: request method used to send http request. - # possible values GET, POST, HEAD, PUT, DELETE, PATCH. 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+. + # - +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 & sending two params + # Example calling +create+ action and sending two params: # - # process :create, 'POST', user: { name: 'Gaurish Sharma', email: 'user@example.com' } + # process :create, 'POST', user: { name: 'Gaurish Sharma', email: 'user@example.com' } # - # another example with parameters, +nil+ session & flash message + # Example sending parameters, +nil+ session and setting a flash message: # - # process :view, 'GET', { id: 7 }, nil, { message: 'This is 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 respectively which will make tests more expressive. + # 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. def process(action, http_method = 'GET', *args) -- cgit v1.2.3