Nevermind! I figured out that (in my case) I simply needed to instantiate an
instance of ActionController::Base and then stub the methods on the
instance:
@controller = ActionController::Base.new
@controller.stub!(:params).and_return(:foo => 'bar')

I then run my expectations against @controller, whereas before I was running
each of my expectations against a new instance of ActionController::Base (
i.e. ActionController::Base.new.should...)

On 10/16/07, Jed Hurt <[EMAIL PROTECTED]> wrote:
>
> Has anyone had any success stubbing ActionController::Base#params? The
> following is not intercepting calls to params[:foo] in my controllers:
>
> ActionController::Base.stub!(:params).and_return(:foo => 'bar')
>
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to