Yehuda Katz and Ryan Bigg are a great upcoming book, Rails 3 in action , there is a chapter on creating a test JSON API on top of an example application that runs through the entire book.
Although I highly recommend buying a copy of the beta version of the book, the code for the Ticketee sample application is open source and can be found on GitHub . In particular, all API-related name relationships are under /app/controllers/api , and you can find many RSpec tests in /spec/api .
I was in the same position a couple of months ago when I had to write the JSON API for the iPhone application, so I know well the lack of good, test-oriented, relevant tutorials on the Internet. Fortunately for me, I learned about the book, and it turned out to be an absolute life-saving.
Leo Cassarani Jul 31. '11 at 12:59 2011-07-31 12:59
source share