You could use an in-memory database if all you require is speed, but it is an all or nothing solution, not one that is isolated to these specific tests. If you have loads of fixtures / dump a lot of stuff into your testing db it also might not be appropriate for memory usage reasons.
Not sure which db you are using so I won't point out any specifics(I just googled for them anyway). Richard McGain On Fri, Aug 26, 2011 at 3:03 PM, Dmytrii Nagirniak <[email protected]> wrote: > I would have thought this situation would be fairly common in a rails >> application, how are people handling this currently? > > > I would just hit the database. Correct behavior here would be more > important than couple of milliseconds saved. > > It reminds me 2 things: > > 1. When rails 3 was released it could not boot even though all tests > passed. The reason was that boot-up process was stubbed (don't remember > exact details though). > > 2. you can't stub one of the most powerful things - plain SQL. I saw people > stubbing it and checking SQL that would be executed. It might work, but it > is something that is too much detached from real situation. > > I might be in minority, but I prefer to stub as little as possible. Most of > it would be something without consistent state (database has consistent > state), availability etc. Not necessarily external services (http requests), > but internal as well (Time). > > -- > You received this message because you are subscribed to the Google Groups > "Ruby or 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. > -- You received this message because you are subscribed to the Google Groups "Ruby or 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.
