Skip to content

Instantly share code, notes, and snippets.

@fnando
Created October 24, 2012 20:03
Show Gist options
  • Select an option

  • Save fnando/3948473 to your computer and use it in GitHub Desktop.

Select an option

Save fnando/3948473 to your computer and use it in GitHub Desktop.
Running specs with all available locales
module RSpecHelpers
def _(*args, &block)
translation = I18n.t(*args, &block)
expect(translation).not_to include("translation missing")
translation
end
end
desc "Execute specs setting locale"
task :"spec:i18n" => :environment do
I18n.available_locales.each do |locale|
ENV["RAILS_LOCALE"] = locale.to_s
Rake::Task["spec"].reenable
Rake::Task["spec"].invoke
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment