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

Michael B. Klein mbklein at gmail.com
Sat Mar 26 02:11:49 EDT 2011

What happens if you

Page.stub_chain(:criteria, :id).and_return([mock_model("Page", :title =>

(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 <amkirwan 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-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20110325/8bacde6c/attachment.html>

More information about the rspec-users mailing list