aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/testing/test_request.rb
Commit message (Collapse)AuthorAgeFilesLines
* Fix bug when Rails.application is defined but is nil. See #881Marc-Andre Lafortune2012-08-281-1/+1
|
* Add backward compatibility for testing cookiesAndrew White2011-06-051-1/+7
| | | | | | | | | | | | | | | | | | | This commit restores the ability to assign cookies for testing via @request.env['HTTP_COOKIE'] and @request.cookies, e.g: @request.env['HTTP_COOKIE'] = 'user_name=david' get :index assert_equal 'david', cookies[:user_name] and @request.cookies[:user_name] = 'david' get :index assert_equal 'david', cookies[:user_name] Assigning via cookies[] is the preferred method and will take precedence over the other two methods. This is so that cookies set in controller actions have precedence and are carried over between calls to get, post, etc.
* Refactor ActionController::TestCase cookiesAndrew White2011-06-041-25/+0
| | | | | | | | | | | | | | | | | | Assigning cookies for test cases should now use cookies[], e.g: cookies[:email] = 'user@example.com' get :index assert_equal 'user@example.com', cookies[:email] To clear the cookies, use clear, e.g: cookies.clear get :index assert_nil cookies[:email] We now no longer write out HTTP_COOKIE and the cookie jar is persistent between requests so if you need to manipulate the environment for your test you need to do it before the cookie jar is created.
* Improve testing of cookies in functional tests:Andrew White2011-03-061-1/+6
| | | | | | | | | - cookies can be set using string or symbol keys - cookies are preserved across calls to get, post, etc. - cookie names and values are escaped - cookies can be cleared using @request.cookies.clear [#6272 state:resolved]
* Initialize @cookies.Emilio Tagua2010-09-271-0/+1
|
* Don't shadow outer local variables.Emilio Tagua2010-09-271-1/+1
|
* Added ability to set asset_path for enginesPiotr Sarnacki2010-09-031-1/+1
|
* Rename config.cookie_secret to config.secret_token and pass it as ↵José Valim2010-04-051-0/+2
| | | | configuration in request.env. This is another step forward removing global configuration.
* adds missing requires for Object#blank? and Object#present?Xavier Noria2010-03-281-0/+2
|
* Switch functional tests to run through the rack interface instead of processJoshua Peek2009-05-021-0/+5
|
* Move TestRequest#query_parameters into AD TestRequestJoshua Peek2009-04-301-0/+4
|
* Move TestRequest cookies accessor into AD TestRequestJoshua Peek2009-04-301-3/+21
|
* Start moving TestRequest and TestResponse into ActionDispatchJoshua Peek2009-04-301-0/+56