| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
Just include the modules necessary in the Request object to implement
the things we need. This should make it easier to build delegate
request objects because the API is smaller
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With changes made in 8363b8 and ae29142 cookies that are mutated on the
request like `cookies.signed = x` were not retained in subsequent tests,
breaking cookie authentiation in controller tests.
The test added demonstrates the issue.
The reason we need to select from non-deleted cookies is because without
checking the `@delete_cookies` the `cookie_jar` `@cookies` will send the
wrong cookies to be updated. The code must check for `@deleted_cookies`
before sending an `#update` with the requests cookie_jar cookies.
This follows how the cookie_jar cookies from the request were updated
before these changes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The following Rails code failed (with a `KeyError` exception) under
test:
```ruby
class ApplicationController < ActionController::Base
def user_strategy
# At this point:
# ```ruby
# session == {
# "user_strategy"=>"email",
# "user_identifying_value"=>"hello@world.com"
# }
# ```
if session.key?(:user_strategy)
session.fetch(:user_strategy)
end
end
end
```
When I checked the session's keys (`session.keys`), I got an array of
strings. If I accessed `session[:user_strategy]` I got the expected
`'email'` value. However if I used `session.fetch(:user_strategy)` I
got a `KeyError` exception.
This appears to be a Rails 4.2.4 regression (as the code works under
Rails 4.2.3).
Closes #21383
|
| |
|
|
|
|
| |
superclass already has this method, so remove this one
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is part of a larger refactoring on controller tests. We needed to
move these methods here so that we could get rid of the `|| key ==
:action || key == :controller` in `assign_parameters`. We know this is
ugly and intend to fix it but for now `generate_extras` needs to be used
in the two methods to access the path and the query_string_keys.
We're adding `:controller` and `:action` to the `query_string_keys`
because we always need a controller and action. If someone passed
`action` or `controller` in in there test they are unambigious - we
know they have to go into the query params.
|
|
|
|
|
|
| |
`extra_keys` is a confusing variable name because it's not clear what is
"extra". This renames it to `query_string_keys` so it's clear that the
"extra" is just the query string.
|
|
|
|
| |
allow testing controllers that use session#fetch with a default value.
|
|
|
|
| |
Rack [already implements `redirect?` on the response object](https://github.com/rack/rack/blob/1569a985e17d9caaf94d0e97d95ef642c4ab14ba/lib/rack/response.rb#L141) so we don't need to implement our own.
|
|
|
|
|
| |
ActionController::TestResponse was removed in d9fe10c and caused a test
failure on Action View as its test case still refers to it.
|
| |
|
| |
|
| |
|
|
|
|
| |
PATH_INFO is already set, so this branch will never execute.
|
|
|
|
|
|
| |
we were already generating a path in the previous code (it was just not
returned), so lets just use the already computed path to popluate the
PATH_INFO header
|
| |
|
|
|
|
| |
Since we only work with new instances, these ivars will not be set.
|
|
|
|
|
| |
We should call the setter on `path_parameters` so that we know the hash
will only contain the values that we've set.
|
|
|
|
|
| |
I'd like to put all env mutations together so we can understand how to
change this code to call `call` on the controller
|
|
|
|
|
| |
Since parameters are converted to a query string, they will
automatically be turned in to strings by the query parser
|
|
|
|
|
| |
non_path_parameters is used internally (it never escapes this method) so
we should be able to safely use a regular hash.
|
|
|
|
|
| |
since we are serializing parameters, we don't need to do all the dup
checks on each object.
|
|
|
|
|
|
| |
We should roundtrip the parameters through their respective encoders /
decoders so that the controller will get parameters similar to what they
actually get in a real world situation
|
|
|
|
|
|
| |
We should convert request parameters to a query string, then let the
request object parse that query string. This should give us results
that are more similar to the real-world
|
|
|
|
|
| |
We should assign parameters to the request object rather than mutate the
hash that is returned by `query_parameters` or `request_parameters`
|
|
|
|
| |
this prevents mutations from being available globally
|
|
|
|
|
|
| |
Instead of trying to manually clear out a request object, lets just
allocate a new one. The rack ENV is reused and cleaned (still), but the
request object is not.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
There is no reason to "recycle" response objects when we can just
allocate a new one.
|
|
|
|
|
| |
we should be pushing the cookies in via headers rather than maintaining
some object and "recycling" it.
|
| |
|
| |
|
|\
| |
| | |
Deprecate `assert_template` and `assigns()`.
|
| | |
|
|/
|
|
|
|
| |
It's better to use Ruby methods when possible over methods defined by
Active Support because then it does not need to rely on any
dependencies.
|
|
|
|
| |
Code was moved into the `assign` method.
|
|\
| |
| | |
[PoC] Stop shadowing parameters named `action`
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This moves `TemplateAssertions` out of the `test_case.rb` file and into
it's own `template_assertions` file. It still inherits from
`ActionController`.`
This is in preparation for combining the code for Integration tests and
Controller tests. This will need to be it's own file to be added to the
`requires` for Integration tests. This does not currently change ANY
behavior, just moving it for access later on.
|
|/
|
|
|
|
| |
`*args` is not required here and should be avoided when not necessary
because `*args` are slower than `args` and create unnecessary array
allocations.
|
|
|
|
|
|
|
| |
supercaracal/fix_force_ssl_redirection_flash_error"
This reverts commit d215620340be7cb29e2aa87aab22da5ec9e6e6a7, reversing
changes made to bbbbfe1ac02162ecb5e9a7b560134a3221f129f3.
|
| |
|