views:

306

answers:

2

I use Rails 2.3 i18n with a database backend plugin :

http://github.com/dylanz/i18n_backend_database

This stores my translations and locales in two DB tables. What would be the best way to get these tables working with my tests? I'm guessing I could write a rake task that would copy the tables from the development DB to the test DB.

Any suggestions?

+1  A: 

You could put the data in a seeds.rb file and run that task when loading your test environment. The benefit of this is that you'll also have some way of regaining a basic data structure if you, for some reason, wipe your computer.

Ryan Bigg
+1  A: 

One thing you could try is using fixtures for this. Do a google search for db:fixtures:dump or db:fixtures:export_all Rolling own your own implementation should be pretty easy as well.

psyho