Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'hotfix/0.0.1.1' into develop
Conflicts: Changelog.md config/defaults.yml
- Loading branch information
Showing
3 changed files
with
55 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,50 @@ | |||
require 'spec_helper' | |||
|
|||
describe 'locale files' do | |||
describe "cldr/plurals.rb" do | |||
AVAILABLE_LANGUAGE_CODES.each do |locale| | |||
describe "#{locale} plural rules" do | |||
it "defines the keys" do | |||
I18n.with_locale locale do | |||
expect { | |||
I18n.t 'i18n.plural.keys' | |||
}.to_not raise_error | |||
end | |||
end | |||
|
|||
it "defines a valid pluralization function" do | |||
I18n.with_locale locale do | |||
expect { | |||
rule = I18n.t 'i18n.plural.rule', resolve: false | |||
rule.call(1) | |||
}.to_not raise_error | |||
end | |||
end | |||
|
|||
it "defines a valid javascript pluralization function" do | |||
I18n.with_locale locale do | |||
expect { | |||
ExecJS.eval I18n.t('i18n.plural.js_rule') | |||
}.to_not raise_error | |||
end | |||
end | |||
end | |||
end | |||
end | |||
|
|||
AVAILABLE_LANGUAGE_CODES.each do |locale| | |||
["diaspora/#{locale}.yml", | |||
"devise/devise.#{locale}.yml", | |||
"javascript/javascript.#{locale}.yml"].each do |file| | |||
describe file do | |||
it "has no syntax errors if it exists" do | |||
file = Rails.root.join("config", "locales", file) | |||
pending "Not yet available" unless File.exists? file | |||
expect { | |||
YAML.load_file file | |||
}.to_not raise_error | |||
end | |||
end | |||
end | |||
end | |||
end |