Quick question on rspec-rails for Rails 3: how to stub AR class methods like :find?

Hey,

I recently switched to Rails 3(.1) and, using rspec-rails 2.6.1, I
find can no longer stub AR class methods, like :find.

So, where Comment is an AR class, I can’t do this:

Comment.should_receive(:find).and_return(…

What is the new way of doing this, please?

Lille

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs