adding i18n integrity check for valid YAML and valid content

This commit is contained in:
Kuba Brecka
2013-03-23 08:57:31 +01:00
parent 4907d162ef
commit 624649ddc2
3 changed files with 1639 additions and 0 deletions

View File

@@ -21,6 +21,23 @@ describe "i18n integrity checks" do
end
end
it "has valid YAML for client and server" do
Dir["#{Rails.root}/config/locales/*.yml"].each do |f|
locale = /.*\.([^.]{2,})\.yml$/.match(f)[1]
client = YAML.load_file("#{Rails.root}/config/locales/client.#{locale}.yml")
client.count.should == 1
client[locale].should_not == nil
client[locale].count.should == 2
client[locale]["js"].should_not == nil
client[locale]["admin_js"].should_not == nil
server = YAML.load_file("#{Rails.root}/config/locales/server.#{locale}.yml")
server.count.should == 1
server[locale].should_not == nil
end
end
it "does not overwrite another language" do
Dir["#{Rails.root}/config/locales/*.yml"].each do |f|
locale = /.*\.([^.]{2,})\.yml$/.match(f)[1] + ':'