Created
October 24, 2012 20:03
-
-
Save fnando/3948473 to your computer and use it in GitHub Desktop.
Running specs with all available locales
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module RSpecHelpers | |
| def _(*args, &block) | |
| translation = I18n.t(*args, &block) | |
| expect(translation).not_to include("translation missing") | |
| translation | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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