`#find` is talking about an instance method, not a class method.

You need to define it:

class EmProfiOption < ActiveRecord::Base def find(*args); super end end

Relevant documentation:
https://www.relishapp.com/rspec/rspec-mocks/v/3-2/docs/verifying-doubles/dynamic-classes

Cheers, Xavier

On Tue, Feb 17, 2015, at 04:49 AM, croceldon wrote:
> I'm running into this error after updating to rspec 3.2:
>
> EmProfiOption does not implement #find
>
> EmProfiOption is an AR model. Here's the line causing the trouble:
>
> allow(EmProfiOption).to
> receive(:find).and_return(profi.em_profi_option)
>
> This occurs even if I add the following:
>
>  EmProfiOption.define_attribute_methods
>
> Any ideas on how to resolve?
>
> Thanks much
>


> --
>
You received this message because you are subscribed to the Google
Groups "rspec" group.
>
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected].
>
To post to this group, send email to [email protected].
>
To view this discussion on the web visit
https://groups.google.com/d/msgid/rspec/24ead06b-b9ee-42d8-b3fe-318bc4992ec5%40googlegroups.com[1].
>
For more options, visit https://groups.google.com/d/optout.



Links:

  1. 
https://groups.google.com/d/msgid/rspec/24ead06b-b9ee-42d8-b3fe-318bc4992ec5%40googlegroups.com?utm_medium=email&utm_source=footer

-- 
You received this message because you are subscribed to the Google Groups 
"rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rspec/1424109229.2884817.228196693.484DD8E2%40webmail.messagingengine.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to