Example rals json APIs using Rspec tests

I am looking for a good Rails 3 project repository that implements the JSON API and includes RSpec tests. A complete tutorial would be great, but I would only agree to a well-commented example.

+42
json api ruby-on-rails rspec bdd
Jul 30 '11 at 19:38
source share
3 answers

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.

+65
Jul 31. '11 at 12:59
source share

RubyGems.org is open source and has a great example API.

+9
Oct 18 '12 at 8:31
source share

It is not necessary to respond to an api example, but I can definitely vouch for testing the rails 3 application API in processes.

Here you go: whitneytaylorimura.wordpress.com

It has a complete example of using Cucumber, Rspec, and FactoryGirl to create your objects (using DatabaseCleaner to clean them).

0
Jun 12 '13 at 19:29
source share



All Articles