1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

3 commits

Author SHA1 Message Date
Kasper Timm Hansen
333670ceb9 Let TestResponse assign a parser.
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.
2016-07-10 22:02:12 +02:00
Aaron Patterson
9cff248469 only call methods that are on the superclass
We want to treat the response object as if it's a real response object
(not a test object), so we should only call methods that are on the
superclass.
2015-07-14 07:46:17 -07:00
John Firebaugh
c509379923 Add ActionDispatch::TestResponse tests.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-25 10:52:57 +02:00