Tutorial :Testing rails application with a I18N database backend


I use Rails 2.3 i18n with a database backend plugin :


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?


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.


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.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »