You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before upgrade to Rails 7.1.2, both response and response.parsed_body returned properly rendered JSON for an API that uses Rails ActiveModelSerializers. After the upgrade, response contains the ActiveModelSerializers object simply returned as string, instead of the actual render.
> response=> ...
@stream=#<ActionDispatch::Response::Buffer:0x0000000135a98810@buf=["\"#<ActiveModelSerializers::Adapter::Attributes:0x0000000135add410>\""],
> response.body# or response.parsed_body, same result=>"#<ActiveModelSerializers::Adapter::Attributes:0x000000012149dd70>"
Expected behaviour
In requests specs, response from a test for an API that uses ActiveModelSerializers and returns JSON, should return properly rendered JSON object, instead it returns the serializer instance.
Can you provide an example reproduction?
I created a brand new Rails 7.2 application with ActiveModelSerializers, but with stadard Rails setup and it properly renders the JSON object in the Integration test
which proves this is not an issue with ActiveModelSerializers, because it produces proper results with standard Rails 7.2.1 test suite. Not sure if this is an issue with rspec-rails or another gem from rspec group, so posting it here.
The text was updated successfully, but these errors were encountered:
What Ruby, Rails and RSpec versions are you using?
Ruby version: 3.2.5
Rails version: 7.2.1
RSpec version: rspec-rails 7.0.1 , rspec-core 3.13.1
Observed behaviour
Before upgrade to Rails 7.1.2, both
response
andresponse.parsed_body
returned properly rendered JSON for an API that uses Rails ActiveModelSerializers. After the upgrade, response contains the ActiveModelSerializers object simply returned as string, instead of the actual render.Expected behaviour
In requests specs, response from a test for an API that uses ActiveModelSerializers and returns JSON, should return properly rendered JSON object, instead it returns the serializer instance.
Can you provide an example reproduction?
I created a brand new Rails 7.2 application with ActiveModelSerializers, but with stadard Rails setup and it properly renders the JSON object in the Integration test
which proves this is not an issue with ActiveModelSerializers, because it produces proper results with standard Rails 7.2.1 test suite. Not sure if this is an issue with rspec-rails or another gem from rspec group, so posting it here.
The text was updated successfully, but these errors were encountered: