views:

21

answers:

0

I'am currently trying to get i18n into our rails application. I use cucumber for integration testing and test_unit for everything else.

After the initial translation and "refactoring" the locale file, I have a few missing translations in my app, due to changed translation keys. What I want now, is that cucumber reports all missing translations while running the tests. I found a nice blog post about i18n testing with test_unit (http://dev.innovationfactory.nl/2009/05/04/rails-i18n-caveats-and-tips/) which works quite nice.

I tried to set the exception handler in a before hook in cucumber but is does not really work. The only i18n exception that is raised comes from "less_that_x_minutes", although there there are much more broken translation currently.

How can I get cucumber to report all i18n exceptions?

Thanks in advance, Simon

PS: thats the code from the blog post above that I use in test_helper.rb and which works fine for functional tests:

# raise localisation exception
module I18n 
  def self.just_raise(*args) 
    raise args.first 
  end 
end
I18n.exception_handler = :just_raise