[rspec-users] find_all_by returning nil

Maurício Linhares mauricio.linhares at gmail.com
Mon Aug 11 14:32:29 EDT 2008


And i think that stubbed classes or objects can not access the database.

On Mon, Aug 11, 2008 at 3:31 PM, Craig Demyanovich
<cdemyanovich at gmail.com> wrote:
> Looks like this line
>
> Product.stub(!find_all_by_category_id).with(anything()).and_return([product])
>
> might be the culprit. It should be stub!(find... instead of stub(!find....
>
> Regards,
> Craig



-- 
Maurício Linhares
http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en)
João Pessoa, PB, +55 83 8867-7208


More information about the rspec-users mailing list