问题描述
我在寻找一个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比格的优秀即将出版的新书,。特别是,一切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的例子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!