# Testing without a test database

**URL:** <https://www.ruby-forum.com/t/testing-without-a-test-database/127169>\
**Category:** Rails\
**Created:** [January 25, 2008, 6:34pm UTC](https://www.ruby-forum.com/t/testing-without-a-test-database/127169 "2008-01-25T18:34:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bcm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/977dab/32.png) [@bcm](https://www.ruby-forum.com/u/bcm)\
**Post date:** [January 25, 2008, 6:34pm UTC](https://www.ruby-forum.com/t/testing-without-a-test-database/127169/1 "2008-01-25T18:34:38Z")

</div>

Hi all,

I’m working on a very large, very complex legacy database (Oracle, \> 4GB  
of text data in 1000s of tables). For this situation, dropping tables  
and populating them from fixtures just isn’t feasible: I can’t load  
500MB of data every time I want to test my app. I also can’t muck with  
the dev database, since it is used by other developers for other  
projects, and only gets cloned from the production DB once every few  
months. Is there a way to short circuit the typical testing methods to  
have them open a transaction, load test-specific fixtures, run the tests  
and then close the transaction without dropping the tables first?

I’ve been googling like mad and I can’t seem to find anything, but I’m  
sure that I’m not the first person to run into this problem.

Any help would be appreciated.

Thanks!

---

<div class="post-metadata">

**Author:** ![bcm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/977dab/32.png) [@bcm](https://www.ruby-forum.com/u/bcm)\
**Post date:** [January 27, 2008, 10:46am UTC](https://www.ruby-forum.com/t/testing-without-a-test-database/127169/2 "2008-01-27T10:46:55Z")

</div>

I can’t give you specific code examples because I am just getting into  
testing myself so I just don’t know enough. Right now I am working  
through “The Rails Way” ([http://www.amazon.com/Rails-Way-Addison-](http://www.amazon.com/Rails-Way-Addison-)  
Wesley-Professional-Ruby/dp/0321445619). It has some great stuff on  
mocks and stubs that allows you to do a lot of testing without hitting  
the database.

I hope that helps.

On Jan 25, 9:34 am, Brent M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
