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

Tom Stuart tom at experthuman.com
Fri Jun 15 16:21:14 EDT 2007

On 15 Jun 2007, at 19:53, Ingo Weiss wrote:
> I thought that .with(:all) would set the expectation that 'find' is
> called with the :all parameter like this:
> Station.find(:all)
> but apparently that is not what's happening

That is what .with(:all) does, but in your controller you're doing

   @stations = Station.find(:all, :order => 'name')

i.e. .with(:all, :order => 'name'), so it's no surprise the spec  
fails! :-)


More information about the rspec-users mailing list