Matt Wynne <[EMAIL PROTECTED]> writes: > I want to be able to factor out bits of a controller's behaviour into > modules, and spec them independently. E.g. modules like Authentication > and ExceptionHandling that are mixed into ApplicationController. > > In my spec, I create a FakeController class which inherits from > ActionController::Base, and mix in the module. > > This is working OK, but I'm struggling with the routing so that I can > use the integration session #get method to spin up my FakeController. > I have to set up the routing for this FakeController in a > before(:all), then reload the default routing in after(:all) so as not > to pollute the other specs. > > Is this how other people do this? Is there a trick that I'm missing?
Yeah, it's kind of a bummer, just something you have to deal with cause of Rails. What I do is set up a default route, you know the old-school ':controller/:action/:id' kind. Pat _______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users