Imported from Lighthouse. Original ticket at: http://rails.lighthouseapp.com/projects/8994/tickets/6492
Created by Josep M. Bach - 2011-03-01 15:14:04 UTC
When instantiating an ActionDispatch::TestRequest, it raises an undefined method error when Rails.application is nil. Although it checks for defined?(Rails.application), it fails to check whether the application is really present.
Included patch adds the additional check needed (with tests).
Attachments saved to Gist: http://gist.github.com/971790
Fix bug when Rails.application is defined but is nil. See #881