[rspec-users] alternate way to stub out I18n translations?

Katrina Owen katrina.owen at gmail.com
Wed May 30 20:19:59 UTC 2012


On Wed, May 30, 2012 at 8:55 PM, Patrick J. Collins
<patrick at collinatorstudios.com> wrote:
> Does any one know of a way to temporarily add an entry into my en.yml
> locale dynamically?

I usually do something like this in the before filter

   en = { :my => { :stuff => 'things' } }
   I18n.backend.store_translations(:en, en)

Cheers,
Katrina


More information about the rspec-users mailing list