[rspec-users] stubbing mongoid::criteria in view code

amkirwan amkirwan at gmail.com
Tue Mar 29 16:14:07 EDT 2011


that did it thanks.

On Mar 26, 2:11 am, "Michael B. Klein" <mbkl... at gmail.com> wrote:
> What happens if you
>
> Page.stub_chain(:criteria, :id).and_return([mock_model("Page", :title =>
> "foobar")])
>
> (i.e., replace the mocked MongoidCriteria with a single-element Array
> containing the mocked Page)
>
>
>
> On Fri, Mar 25, 2011 at 8:18 AM, amkirwan <amkir... at gmail.com> wrote:
> > no unfortunately that does not work either. I receive the error: undefined
> > method `title' for #<Object:0x00000101cfd080>
> > _______________________________________________
> > rspec-users mailing list
> > rspec-us... at rubyforge.org
> >http://rubyforge.org/mailman/listinfo/rspec-users
>
> _______________________________________________
> rspec-users mailing list
> rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users


More information about the rspec-users mailing list