Max Williams wrote:
[...]
>> for
> Thanks for your advice.  I have access to the AR docs, but doing new
> then save triggers the same callbacks as calling create.

Then maybe it's something else, or maybe I'm thinking of just
bypassing validatons...sorry to have steered you wrong!

>
>>
>>>  I'm in an rspec test and
>>> want to save a model without worrying about the callback stuff.
>>
>> Why?  If you're testing your app, you should have the callbacks work
>> just like in the real thing.
> But i'm not testing the model in question, it's just an associated model
> for the model i am testing.  The callbacks are not relevant to these
> tests at all.

That makes some sense.

>>
>> If you're just trying to cobble together some test data, consider using
>> factories, probably with Machinist.
> Yeah, i know, i have used those before, it just seems like overkill for
> this case.

It's not overkill.  It's the exact situation for which factories are
the perfect solution.  If you've got your blueprints set up right, all
you need is one more .make call.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to