[rspec-users] Testing REST webservices? (Not Rails)

Ashley Moran ashley.moran at patchspace.co.uk
Thu May 22 06:46:27 EDT 2008

On 21 May 2008, at 21:37, Erik Terpstra wrote:

> I am new to RSpec and BDD.
> I was wondering if RSpec specifications are a good solution for  
> testing REST webservices (not implemented in Rails).
> If so, what would be a good way to test something like the API  
> described below?

Hi Erik

RSpec would be fine to test that, it's just a web app returning XML  
instead of HTML.  You don't say what you are building the web service  
in.  If you want acceptance/integration-style specs that are  
implementation-independent, you could use the story runner with steps  
to make HTTP requests.  And look at Kyle's rspec_hpricot_matchers for  
a way of specifying XML output.  You will also want unit specs for  
your models, controllers etc which will be more framework-dependent.

That's all I can offer based on your description.



More information about the rspec-users mailing list