[rspec-users] Specs for ApplicationController, where to put them?

Wincent Colaiuta win at wincent.com
Thu May 24 03:00:48 EDT 2007


The Rails ApplicationController (app/controllers/application.rb)  
serves as an abstract superclass for all other controllers in a Rails  
application and is a good place to put methods and filters which you  
want all of your controllers to use. In my case I'm using it to  
provide methods such as "current_user" and "logged_in?" etc.

By default, RSpec doesn't produce a corresponding spec file for this  
controller.

I've made a spec file (spec/controllers/application_spec.rb) so that  
I can test these methods, but I'm not sure if this is the right thing  
to do. Should I be testing only the non-abstract subclasses instead?

Cheers,
Wincent



More information about the rspec-users mailing list