[rspec-users] [Rails] Controller testing problem

Ignacy Moryc lists at ruby-forum.com
Wed Jul 1 04:18:55 EDT 2009


I'm working on a legacy app - it was created in 1.2.5 then over time
ported to 2.3. It has absolutely no tests - and I'm trying to fix that
in between adding new functionality.

My problem right now is that my ApplicationController is running
before_filters for setting different request variables (like current
location, etc.) and this messes up my tests - I can't test responses
properly (they are all redirects because ApplicationController derives
from SiteController which actions implement setting variables). What's
worse I can't test assigns hash - it doesn't get proper values assigned.

Is there a way for RSpec to skip the filters in tests? Or to stop
ApplicationController to derive from SiteController?

Posted via http://www.ruby-forum.com/.

More information about the rspec-users mailing list