samedi 3 janvier 2015

How to test non-Rack web services in Rails with Rspec?

I am building a Rails app that will need to utilize a web service in Node, a single endpoint that sends a streaming response. I've been thinking about how to test this, and thought to myself why can't I use RSpec for this rather than using a Javascript testing library? It's just one endpoint, and there is no telling if I will use extensively in the future.


So my question is this: how can I test this API endpoint using RSpec? I found this instructive tutorial for Rack-based apps, but I wonder if there are similar things for non-Rack based apps, as well.


Aucun commentaire:

Enregistrer un commentaire