- View first, then Controller and Model last.
- In Controller tests:
- Don't mock ActiveRecord method
- Do stub ActiveRecord method (No real SQL execution allowed)
- Do mock custom model method
- Use signature from model mock to create real method in model (or module)
- Should not contain more than 5 lines or 10 function calls
- In Model tests:
- Do real SQL execution (No mock, no stub)
Saturday, March 3, 2012
Personal (and non-popular) Rails development rules of thumb
(.getInputArguments (java.lang.management.ManagementFactory/getRuntimeMXBean)) Credit: How to get vm arguments from inside of java applic...
Formatting Run this command in shell sudo cpan JSON::XS Put this line to ~/.vimrc map <leader> jt <Esc> : %! json_xs -f json ...
This error message from chef is not very useful FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit ...
Print some ANSI characters (print (str (char 27) "[2J")) ; clear screen (print (str (char 27) "[;H")) ; move cursor to...