| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| |
| |
| | |
In this commit, we set the content-type to `text/html` in AbstractController if the `options[:html]` is true so that we don't include ActionView::Rendering into ActionController::Metal to set it properly.
I removed the if `options[:plain]` statement because `AbstractController#rendered_format` returns `Mime::TEXT` by default.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* A string in the example lacked quotes.
* The tests asserted stuff about :last_name, whereas
test params do not have that key.
* But, the first one passed, why? After hitting my head against
the wall and doing some obscure rituals realized the new
#require had an important typo, wanted to iterate over the
array argument (key), but it ran over its own hash keys
(method #keys).
* Modified the test to prevent the same typo to happen again.
* The second test assigned to an unused variable safe_params
that has been therefore removed.
* Grammar of the second test description.
* Since I was on it, reworded both test descriptions.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This PR adds ability to accept arrays which allows you to require multiple values in one method. so instead of this:
```ruby
params.require(:person).require(:first_name)
params.require(:person).require(:last_name)
```
Here it will be one line for each params, so say if I require 10params, it will be 10lines of repeated code which is not dry. So I have added new method which does this in one line:
```ruby
params.require(:person).require([:first_name, :last_name])
```
Comments welcome
|
|\ \
| | |
| | |
| | |
| | | |
jeremyf/updating-ActionController-TestSession-to-behave-as-a-hash-with-indifferent
Updating TestSession to access with indifference
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| | |
| | |
| | |
| | |
| | |
| | | |
Since all controller instances are required to have a request and
response object, RackDelegation is no longer needed (we always have to
delegate to the response)
|
| | |
| | |
| | |
| | | |
without this module, the content type is not set correctly
|
|/ /
| |
| |
| | |
method_call_assertions
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Controllers should always have a request and response when responding.
Since we make this The Rule(tm), then controllers don't need to be
somewhere in limbo between "asking a response object for a rack
response" or "I, myself contain a rack response". This duality leads to
conditionals spread through the codebase that we can delete:
* https://github.com/rails/rails/blob/85a78d9358aa728298cd020cdc842b55c16f9549/actionpack/lib/action_controller/metal.rb#L221-L223
|
| | |
|
| |
| |
| |
| | |
collect the body and make assert against the collected body
|
| |
| |
| |
| | |
This saves a lambda and request allocation on each request.
|
|\ \
| | |
| | | |
Get rid of mocha tests in actionpack - part 2
|
| | | |
|
|\ \ \
| | | |
| | | | |
Remove more unused block arguments
|
| | | | |
|
|\ \ \ \
| |/ / /
|/| | | |
Trim out least needed controllers from AP test suite
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
add missing test for action regexp for routing
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | | |
We should keep the route set generation logic in one place
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
If we subclass and augment the superclass, then we don't need to have
setters for particular things on the superclass.
|
| | | | |
| | | | |
| | | | | |
`:nail_care:`
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
controller class resolution has been moved to the request object, so we
should override that method instead of relying on the RouteSet to
generate the controller class.
|
|\ \ \ \ \
| |_|_|/ /
|/| | | | |
Remove unused variables
|
| | |/ /
| |/| | |
|
|\ \ \ \
| |/ / /
|/| | | |
Get rid of mocha tests in actionpack - part 1
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | | |
This commit allows us to use one request object rather than allocating
multiple request objects to deal with the session.
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This refactoring moves the controller class name that was on the route
set to the request. The purpose of this refactoring is for changes we
need to move controller tests to integration tests, mainly being able to
access the controller on the request instead of having to go through
the router.
[Eileen M. Uchitelle & Aaron Patterson]
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
I'm going to change the constructor, so it's easier to do it in one
place.
|
|\ \ \
| | | |
| | | | |
Remove duplicity in tests
|
| |/ / |
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
nobody should be touching the routes hash without going through the
NamedRouteCollection object.
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
I want to change the real constructor to take a particular parameter for
matching the request method
|
| | |
| | |
| | |
| | |
| | | |
The string we create is almost always the same, so rather than joining
all the time, lets join once, then reuse that string everywhere.
|
| | |
| | |
| | |
| | |
| | |
| | | |
We should build the routes using the user facing API which is `Mapper`.
This frees up the library internals to change as we see fit. IOW we
shouldn't be testing internals.
|
| | |
| | |
| | |
| | |
| | | |
The outer router object already keeps a hash of named routes, so we
should just use that.
|
| | |
| | |
| | |
| | |
| | | |
refactor the tests with a backwards compatible method call so we can rm
add_route2 from the journey router
|
| | |
| | |
| | |
| | |
| | | |
then we can let the mapping object derive stuff that the Route object
needs.
|
| | |
| | |
| | |
| | |
| | | |
now that we aren't doing options manipulations, we can just pass the
mapping object down and read values from it.
|
| | | |
|