Yup cool, so i was on the right track, just got a bit confused as I don't
see the point in testing a model unless you can actually hit the db, as that
can give you information about possible missing sequences, constraints.etc.
that you might not see otherwise =)

Cheers guys.



On Fri, Oct 10, 2008 at 10:23 AM, Anthony Richardson <
[EMAIL PROTECTED]> wrote:

> On Fri, Oct 10, 2008 at 9:50 AM, Torm3nt <[EMAIL PROTECTED]> wrote:
>
>> Can someone explain to me why you shouldn't be hitting the db...
>> especially with model specs? Or is this more for controller specs, whereby
>> you mock out the model (which I do already)?
>>
>>
> Because it's slow. If what you are testing isn't DB specific why suffer the
> penalty? There are a couple of solutions I have seen for making your tests
> run all in memory. On is the set you test db as SQLite with an inmemory
> dataset, the other was a plugin that hacked AR to not make DB calls.
>
> Cheers,
>
> Anthony Richardson
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails Oceania" 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/rails-oceania?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to