Skip to content

Instantly share code, notes, and snippets.

@rodrigopinto
Forked from caike/spec_helper.rb
Created October 25, 2012 15:53
Show Gist options
  • Save rodrigopinto/3953593 to your computer and use it in GitHub Desktop.
Save rodrigopinto/3953593 to your computer and use it in GitHub Desktop.
missing translations
##
# Raises error if missing translation key
##
config.before(:all, type: :controller) do
@_i18n_exception_handler = I18n.exception_handler
I18n.exception_handler = lambda { |*args| raise args.first.to_s }
end
config.after(:all, type: :controller) do
I18n.exception_handler = @_i18n_exception_handler
end
config.before(:all, type: :request) do
@_i18n_exception_handler = I18n.exception_handler
I18n.exception_handler = lambda { |*args| raise args.first.to_s }
end
config.after(:all, type: :request) do
I18n.exception_handler = @_i18n_exception_handler
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment