Rails tests gotcha with I18n.locale 14 January 2012

Ruby, Rails, TestingA example of a bad I18n rails test… Found some tests failing in a project because tests in different files would change I18n.locale, changes like this make your tests fail if the tests are not run in the standard order. since this took me awhile to track down, I thought I should share a quick example for others to find. So if you are having a issue like this remember to add a teardown method that resets I18n.locale to the default local.


Hello, this is where I am publishing my old development blog as well as making new posts in the future. I am not that active with my blogigng these days, but perhaps with a new blog setup I will be slightly more motivated. Currently I am mostly involved with Ruby and mobile development. You can find my code on github.

@DanMayer on Twitter

licensed under a Creative Commons License.
Creative Commons License