[rspec-users] Spec the Application Controller application.rb

Andy Croll lists at ruby-forum.com
Wed Apr 23 02:19:07 EDT 2008

Pat Maddox wrote:
> You can define a controller method on the fly in order to test this
> out.  I just did a quick experiment to demonstrate it...obviously
> modify to suit your needs.

Thanks Pat.

I think I'm confusing two issues.

1) How to test before filters for something like authentication
2) How to test functions provided in the application controller

I'm not putting the before filter in the application.rb, I'm likely to 
be using it to protect various actions in the app.

Is there a way to to call methods directly within the application.rb, 
spec them there and then sub for functionality in the other controllers?


PS Your 'controller spec' blog post was the 'light-going-on-in-my-head' 
moment for RSpec. Thanks for that!
Posted via http://www.ruby-forum.com/.

More information about the rspec-users mailing list