aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/testing/request_encoder.rb
Commit message (Collapse)AuthorAgeFilesLines
* Remove default argument value.Kasper Timm Hansen2016-11-271-1/+1
| | | | Wrongly added when fixing the request path wrangling.
* Use accept header instead of mangling request path.Kasper Timm Hansen2016-11-231-16/+15
| | | | | | | | | | | | | | Instead of appending a format to the request, it's much better to just pass a more appropriate accept header. Rails will figure out the format from that instead. This allows devs to use `:as` on routes that don't have a format. Introduce an `IdentityEncoder` to avoid `if request_encoder`, essentially a better version of the purpose of the `WWWFormEncoder`. One that makes conceptual sense on GET requests too. Fixes #27144.
* Let TestResponse assign a parser.Kasper Timm Hansen2016-07-101-0/+54
Previously we'd only assign a response parser when a request came through Action Dispatch integration tests. This made calls to `parsed_body` when a TestResponse was manually instantiated — though own doing or perhaps from a framework — unintentionally blow up because no parser was set at that time. The response can lookup a parser entirely through its own ivars. Extract request encoder to its own file and assume that a viable content type is present at TestResponse instantiation. Since the default response parser is a no-op, making `parsed_body` equal to `body`, no exceptions will be thrown.