Did Xavier’s suggestion fix your issue? If not can you gist more of your spec?

Jon Rowe
---------------------------
[email protected]
jonrowe.co.uk


On Tuesday, 17 February 2015 at 04:53, Xavier Shay wrote:

> `#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] 
> > (mailto:[email protected]).
> > To post to this group, send email to [email protected] 
> > (mailto:[email protected]).
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/rspec/24ead06b-b9ee-42d8-b3fe-318bc4992ec5%40googlegroups.com
> >  
> > (https://groups.google.com/d/msgid/rspec/24ead06b-b9ee-42d8-b3fe-318bc4992ec5%40googlegroups.com?utm_medium=email&utm_source=footer).
> > For more options, visit https://groups.google.com/d/optout.
>    
>  
> --  
> 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] 
> (mailto:[email protected]).
> To post to this group, send email to [email protected] 
> (mailto:[email protected]).
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/rspec/1424109229.2884817.228196693.484DD8E2%40webmail.messagingengine.com
>  
> (https://groups.google.com/d/msgid/rspec/1424109229.2884817.228196693.484DD8E2%40webmail.messagingengine.com?utm_medium=email&utm_source=footer).
> For more options, visit https://groups.google.com/d/optout.

-- 
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/9DF8C9DF1BA74283972E8319512E897D%40jonrowe.co.uk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to