[rspec-users] Story for Rest

Olivier Dupuis olivierdupuis at gmail.com
Fri Jun 20 12:32:09 EDT 2008

Hello all,

I'm trying to write a story for a rest resource.

Here's what I have so far:

Story "Get prices for specific book", %{
  As a client
  I want to get a list of prices for a specific book
  So that I can use it on my own application
}, :type => RailsStory do

  Scenario "Requesting /books/:id/prices using GET" do
    Given "a regular rest request"

    When "visiting", "/books/:id/prices" do |path|
      get path

    Then "it should return an xml file"

How would I check that the format of my response is in xml?  Also, is it
possible to check the content of an xml file, to make sure that it's not
empty?  Any other suggestions on what would make this story more efficient?

Thanks again

Olivier Dupuis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20080620/fc8a7d96/attachment.html>

More information about the rspec-users mailing list