Skip to content

Allow using parsed_body in ActionController::TestCase#34717

Merged
kaspth merged 1 commit intorails:masterfrom
tbuehlmann:controller-test-parsed-body
Dec 17, 2018
Merged

Allow using parsed_body in ActionController::TestCase#34717
kaspth merged 1 commit intorails:masterfrom
tbuehlmann:controller-test-parsed-body

Conversation

@tbuehlmann
Copy link
Copy Markdown
Contributor

@tbuehlmann tbuehlmann commented Dec 16, 2018

Summary

Allow using parsed_body in ActionController::TestCase by switching the initialzation of an appropriate response parser
in ActionDispatch::TestResponse from eagerly to lazily.

By doing so, the response parser can be correctly set for
ActionController::TestCase, which doesn't include
the content type header in the constructor but only sets it at
a later time.

Fixes #34676.

@rails-bot rails-bot Bot added the actionpack label Dec 16, 2018
@tbuehlmann tbuehlmann changed the title Allow using parsed_body in ActionController::TestCase Allow using parsed_body in ActionController::TestCase Dec 16, 2018
… by switching the initialzation of an appropriate response parser
in `ActionDispatch::TestResponse` from eagerly to lazily.

By doing so, the response parser can be correctly set for
`ActionController::TestCase`, which doesn't include
the content type header in the constructor but only sets it at
a later time.

Fixes rails#34676.
@tbuehlmann tbuehlmann force-pushed the controller-test-parsed-body branch from 048193b to 8246a81 Compare December 16, 2018 11:28
@kaspth kaspth merged commit 048e317 into rails:master Dec 17, 2018
@kaspth
Copy link
Copy Markdown
Contributor

kaspth commented Dec 17, 2018

Thanks!

suketa added a commit to suketa/rails_sandbox that referenced this pull request Aug 12, 2019
Allow using parsed_body in ActionController::TestCase
rails/rails#34717
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants