| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
|
|
|
|
|
|
|
|
|
| |
Last August (2015), @tenderlove worked to remove all `@env[]` and `@env[]=`, in
favor of using `set_header`, `get_header`, etc. (Here's an [example
commit](https://github.com/rails/rails/commit/f16a33b68efc3dc57cfafa27651b9a765e363fbf)).
This PR should remove the last uses of these methods, and fully convert
them to the newly standardized API.
|
|
|
|
| |
this prevents mutations from being available globally
|
| |
|
| |
|
| |
|
|
|
|
|
| |
we should be pushing the cookies in via headers rather than maintaining
some object and "recycling" it.
|
| |
|
|
|
|
| |
This pull request is a continuation of https://github.com/rails/rails/commit/925bd975 and https://github.com/rails/rails/commit/8d8ebe3d.
|
|
|
|
|
|
|
| |
Allow REMOTE_ADDR, HTTP_HOST and HTTP_USER_AGENT to be overridden from
the environment passed into `ActionDispatch::TestRequest.new`.
Fixes #11590
|
| |
|
|
|
|
|
|
| |
instead of deleting keys on every instantiation, create defaults we
actually use. eventually we can pass an environment in to the request,
and create a new req / res object on each call.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
- 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]
|
| |
|
| |
|
| |
|
|
|
|
| |
configuration in request.env. This is another step forward removing global configuration.
|
| |
|
| |
|
| |
|
| |
|
|
|