Hi Siva,

Have you tried

```
allow(MyController).to 
receive(:method).with(the_arguments_you_expect).and_return(the_return_value_you_expect)
```

you can drop the with, and the and_return as necessary.

Does that answer the question?

Thanks
—
Sam Phippen

On 7 Jan 2014, at 13:41, siva <[email protected]> wrote:

> 
> 
>  Hi Everyone
> 
>   I am using a model class method on my controller. How can I stub the class 
> method on my controller?
> 
>   Thanks
>     Siva
> 
> -- 
> 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/d4246290-e544-421b-b94f-109a0b66801f%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
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/173E297E-33AC-4220-B8D5-B8EC0CC99050%40googlemail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to