[rspec-users] stub_model() and ActiveRecord Associations

David Chelimsky dchelimsky at gmail.com
Tue Aug 26 22:03:21 EDT 2008


On Tue, Aug 26, 2008 at 8:51 PM, Mark Wilden <mark at mwilden.com> wrote:
> On Tue, Aug 26, 2008 at 5:01 PM, David Chelimsky <dchelimsky at gmail.com>
> wrote:
>
>>
>> @target_comment = stub_model(Target)
>> @target.stub!(:comments).and_return([@target_comment])
>
> That's what we do - what would the drawbacks be?

It's more invasive than I'd like. It's not all that risky though. I
just feel dirty whenever I mock methods on the objects I'm focused on.
FWIW.

Cheers,
David

>
> ///ark
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list