I wasn’t able to find my exact problem from a Google search,
so I’m posting this here in case it helps someone.
I’d like to create an RSpec test that posts a JSON file to
a Rails API controller, and ensure that the correct
The particular use case for me is that my JSON response
must always be the same if the same JSON request is posted.
Here is the code to do it:
The squish method takes care of whitespaces and newlines.
The eql? method tests for equality of the value of an object.
Have a better way or would like to criticize? Please let me know in the comments!