Tech Tidbits - Ruby, Ruby On Rails, Merb, .Net, Javascript, jQuery, Ajax, CSS...and other random bits and pieces.

Thursday, February 21, 2008

Ruby on Rails - Testing with Multiple Databases

I ran into errors when running tests for a Rails app using multiple databases. When testing, fixtures are automatically inserted into the primary database, and I was getting an error on an unused default fixture that was created when I built the model tied to the second database. Removing that fixture got my tests to pass...

More info here:

http://www.elctech.com/2007/3/8/using-and-testing-rails-with-multiple-databases
http://www.elctech.com/2007/5/30/using-and-testing-multiple-databases-in-rails-part-2

and on multiple databases in general:

http://wiki.rubyonrails.org/rails/pages/HowtoUseMultipleDatabases
http://wiki.rubyonrails.org/rails/pages/HowtoUseMultipleDatabasesWithFixtures

No comments:

About Me

My photo
Developer (Ruby on Rails, iOS), musician/composer, Buddhist, HSP, Vegan, Aspie.

Labels