Skip to content

Support Rails' parsed_body #140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tagliala opened this issue Feb 26, 2023 · 0 comments · Fixed by #143
Closed

Support Rails' parsed_body #140

tagliala opened this issue Feb 26, 2023 · 0 comments · Fixed by #143

Comments

@tagliala
Copy link
Contributor

tagliala commented Feb 26, 2023

Hi, this enhancement can also be considered as an issue

There is a new RuboCop Rails cop that checks for the usage of parsed_body rubocop/rubocop-rails#863

Ref: https://api.rubyonrails.org/classes/ActionDispatch/TestResponse.html#method-i-parsed_body

I've noticed that out of the box JSON API does not convert parsed_body into a Hash

Compatibility has been added in Rails 6.0 via rails/rails#34717

Expected

response.parsed_body.class
Hash

Actual

response.parsed_body.class
String
remear added a commit that referenced this issue May 23, 2023
* Support Rails' `parsed_body` in Integration tests

Ref: https://api.rubyonrails.org/classes/ActionDispatch/TestResponse.html

Close #140

* Add param_encoder to register_encoder

---------

Co-authored-by: Ben Mills <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant