Content

File: October 2009

Every once in a while I see this little code snippet show up somewhere:

script_console_running = ENV.include?(‘RAILS_ENV’) &&
IRB.conf[:LOAD_MODULES] &&
[...]

 ::  (Read the rest of this)

A basic authentication scheme should go to some length to do a little bit of remembering in the event your user hits a restricted page before they are actually authenticated.
First, some context. I’ve got this in my ApplicationController:

def require_user
unless current_user
store_location
redirect_to login_path
[...]

1 comment  ::  (Read the rest of this)

2009-10-09 :: admin // tests
coverage testing

Here’s a little bit of rcov love to ensure that your test suites are covering what they should be.
http://gist.github.com/206379
This should give you:

rake test:rcov
rake test:rcov:units
rake test:rcov:functionals
rake test:rcov:helpers

…with a tailored coverage report for each.
Hopefully this can give you a better idea of where your tests are lacking. As it turns out, despite my app having coverage [...]

 ::  (Read the rest of this)