mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-18 11:32:24 -05:00
Merge pull request #546 from ZogStriP/improve-i18n-spec-speed
prevent double work in the i18n integrity specs
This commit is contained in:
commit
3cb729df21
1 changed files with 7 additions and 3 deletions
|
@ -21,17 +21,21 @@ describe "i18n integrity checks" do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it "has valid YAML for client and server" do
|
it "has valid YAML for client" do
|
||||||
Dir["#{Rails.root}/config/locales/*.yml"].each do |f|
|
Dir["#{Rails.root}/config/locales/client.*.yml"].each do |f|
|
||||||
locale = /.*\.([^.]{2,})\.yml$/.match(f)[1]
|
locale = /.*\.([^.]{2,})\.yml$/.match(f)[1]
|
||||||
|
|
||||||
client = YAML.load_file("#{Rails.root}/config/locales/client.#{locale}.yml")
|
client = YAML.load_file("#{Rails.root}/config/locales/client.#{locale}.yml")
|
||||||
client.count.should == 1
|
client.count.should == 1
|
||||||
client[locale].should_not == nil
|
client[locale].should_not == nil
|
||||||
client[locale].count.should == 2
|
client[locale].count.should == 2
|
||||||
client[locale]["js"].should_not == nil
|
client[locale]["js"].should_not == nil
|
||||||
client[locale]["admin_js"].should_not == nil
|
client[locale]["admin_js"].should_not == nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
it "has valid YAML for server" do
|
||||||
|
Dir["#{Rails.root}/config/locales/server.*.yml"].each do |f|
|
||||||
|
locale = /.*\.([^.]{2,})\.yml$/.match(f)[1]
|
||||||
server = YAML.load_file("#{Rails.root}/config/locales/server.#{locale}.yml")
|
server = YAML.load_file("#{Rails.root}/config/locales/server.#{locale}.yml")
|
||||||
server.count.should == 1
|
server.count.should == 1
|
||||||
server[locale].should_not == nil
|
server[locale].should_not == nil
|
||||||
|
|
Loading…
Reference in a new issue