Useful test helper with rspec for write test code
2011年2月12日星期六
assert_difference
http://shanesbrain.net/2007/5/24/assert_difference-exposed
* Stub - method with canned response
* Mock - object with canned response
http://railsforum.com/viewtopic.php?id=16758
Factory
https://github.com/thoughtbot/factory_girl_rails
factory_girl is a fixtures replacement with a straightforward definition syntax, support for multiple build strategies (saved instances, unsaved instances, attribute hashes, and stubbed objects), and support for multiple factories for the same class (user, admin_user, and so on), including factory inheritance.
http://shanesbrain.net/2007/5/24/assert_difference-exposed
* Stub - method with canned response
* Mock - object with canned response
http://railsforum.com/viewtopic.php?id=16758
Factory
https://github.com/thoughtbot/factory_girl_rails
factory_girl is a fixtures replacement with a straightforward definition syntax, support for multiple build strategies (saved instances, unsaved instances, attribute hashes, and stubbed objects), and support for multiple factories for the same class (user, admin_user, and so on), including factory inheritance.
标签: assert_difference, Factory, Mock, rspec-rails, Stub
发表评论
订阅 博文评论 [Atom]
<< 主页