[rspec-users] problem getting started with stubbing in rails controller specs

Patrick Lenz patrick at limited-overload.de
Fri Jun 15 16:43:40 EDT 2007


On Jun 15, 2007, at 10:16 PM, Kyle Hargraves wrote:

> It is indeed expecting 'find' to be called with(:all), but you aren't
> doing so:
>
>    @stations = Station.find(:all, :order => 'name')
>
> All of the parameters are taken into account. IIRC you can't use with
> (:all, any_args) either, though I might be wrong.

You should actually be able to invoke it this way:

	Station.should_receive(:find).with(:all, anything).and_return 
(@mock_stations)

Best,
Patrick




More information about the rspec-users mailing list