RSpec Test for POSTing a JSON file and Obtaining Correct Response

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
output exists.

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!

Using Gist with WordPress on DreamHost

DreamHost makes it incredible easy to fire up a WordPress app on your domain.

DreamHost has “one-click installs,” which include several open-source tools for a website – including WordPress. It’s free if one has the fully-hosted plan.

One just adds the WordPress app. Once the WordPress app is installed, syntax highlighting can be performed through embedding Gists. It seems to be a simple option for introducing syntax highlighting in code.

I’m using oEmbed Gist, which allows you to paste the URL on it’s own line in the WordPress editor:

…and, voilĂ !

The code is included, syntax highlighting and all!