Re: [rspec-users] Specs for controllers and rescue_from

2010-11-21 Thread Phillip Koebbe
I had a similar problem in the past (with RSpec 1.x). I tend to create what I call a BaseController in each namespace specifically for shared behavior. The best example of this is class Admin::BaseController < ApplicationController before_filter :require_logged_in before_filter :require

Re: [rspec-users] Specs for controllers and rescue_from

2010-11-21 Thread David Chelimsky
On Nov 20, 2010, at 10:12 PM, Nick Hoffman wrote: > Hey guys. My ApplicationController rescues > Mongoid::Errors::DocumentNotFound errors like this: > > class ApplicationController < ActionController::Base > rescue_from Mongoid::Errors::DocumentNotFound, >:with => :resource_not_found >

Re: [rspec-users] specs pass individually, but fail using autotest

2010-11-21 Thread David Chelimsky
On Nov 20, 2010, at 9:49 PM, Doug E. wrote: > Problem discovered, but not solved. It isn't an rspec problem. It's > caused by nifty-authentication's use of Mocha's any_instance. > users_controller_spec.rb's last test calls: > >User.any_instance.stubs(:valid?).and_returns(true) > > This is fi