Raise translation errors in specs

This commit is contained in:
Raphael Sofaer 2011-05-19 17:00:06 -07:00
parent 7912c8af3b
commit c95ce3bd0c

View file

@ -5,3 +5,18 @@ module I18n
end end
I18n.exception_handler = :just_raise_that_exception I18n.exception_handler = :just_raise_that_exception
module ActionView
module Helpers
module TranslationHelper
def translate(key, options = {})
translation = I18n.translate(scope_key_by_partial(key), options.merge!(:raise => true))
if html_safe_translation_key?(key) && translation.respond_to?(:html_safe)
translation.html_safe
else
translation
end
end
alias :t :translate
end
end
end