Testing the db just adds another layer which you can't control. If  
there is something wrong with your db it'll cause all your specs to  
fail, but not for the reason they should be failing. All the  
ActiveRecord db stuff has been already tested in the Rails code so  
there is really no reason to repeat that in your own specs.

The only time you should be hitting the db really is either in  
integration tests or stories because that's when you want to check  
that your whole system works, not just your own code.

Chris

--
chrislloyd.com.au


On 10/10/2008, at 10:20 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)?
>
>
>
> On Fri, Oct 10, 2008 at 10:16 AM, Matt Allen <[EMAIL PROTECTED]>  
> wrote:
> rSpec itself isn't slow.
>
> I'm not a great mocker by any stretch of the imagination and my  
> results look like this:
>
> Finished in 24.500274 seconds
> 979 examples, 0 failures
>
> The vast majority of them goto Mysql in test.
>
> On that note, I'd be very keen to see some other spec output results  
> to gauge what others are dealing with.
>
> Matta
>
>
>
>
>
> >

--~--~---------~--~----~------------~-------~--~----~
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 rails-oceania@googlegroups.com
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