<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener('load', function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <div id="navbar-iframe-container"></div> <script type="text/javascript" src="https://apis.google.com/js/platform.js"></script> <script type="text/javascript"> gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { if (gapi.iframes && gapi.iframes.getContext) { gapi.iframes.getContext().openChild({ url: 'https://www.blogger.com/navbar/4684235500622716427?origin\x3dhttp://blog.caiwangqin.com', where: document.getElementById("navbar-iframe-container"), id: "navbar-iframe" }); } }); </script>

Caiwangqin's blog

Focus on Life, Cloud Service, Smart Hardware, Architecture, Technic and beyond…

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.

标签: , , , ,

posted by Caiwangqin, 10:27

0 Comments:

发表评论

订阅 博文评论 [Atom]

<< 主页