完整的导轨和Rspec的测试JSON API的例子 [英] Complete rails json API example with Rspec tests

查看:194
本文介绍了完整的导轨和Rspec的测试JSON API的例子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在寻找一个Rails 3项目,实现了JSON API,并已列入RSpec的测试,一个很好的例子库。一个完整的教程将是巨大的,但我会满足于只是一个很好的注释的例子。

I'm looking for a good example repository of a Rails 3 project that implements a JSON API and has included RSpec tests. A full tutorial would be great but I'd settle for just a well commented example.

推荐答案

耶胡达·卡茨和Ryan比格的优秀即将出版的新书, Rails 3的在行动对构建贯穿整个书上运行示例应用程序之上的测试驱动JSON API的一章。

Yehuda Katz and Ryan Bigg's excellent upcoming book, Rails 3 in Action, has a chapter on building a test-driven JSON API on top of the example application that runs through the entire book.

虽然我强烈建议购买这本书的beta版的一个副本,在code示例应用程序,Ticketee,是开源的,可以在的 GitHub上。特别是,一切API相关的下 /应用/控制器/ API命名空间,你可以找到很多RSpec的测试,在 /规格/ API

While I strongly recommend buying a copy of the beta edition of the book, the code for the sample application, Ticketee, is open source and can be found on GitHub. In particular, everything API-related is namespaced under /app/controllers/api and you can find plenty of RSpec tests in /spec/api.

我在你同一位置几个月前,当我不得不写一个iPhone应用程序一个JSON API,所以我深知缺乏良好的,测试驱动,相关的教程在网上。幸运的是我,我发现了这本书,它原来是一个绝对的生命的救星。

I was in your same position a couple of months ago when I was having to write a JSON API for an iPhone app so I'm well aware of the lack of good, test-driven, relevant tutorials online. Lucky for me I found out about the book and it turned out to be an absolute life saver.

这篇关于完整的导轨和Rspec的测试JSON API的例子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆