Search code examples
ruby-on-railsrspecinternationalizationrails-i18n

How to make I18n#t method available in rspec tests?


In my test I use I18n#t a lot. Is there a way to make this method available without prefixing it with I18n (as it is possible in views)?


Solution

  • simply

       include ActionView::Helpers::TranslationHelper
    

    where appropriate.