spec/i18n_tasks_spec.rb in i18n-tasks-0.2.0 vs spec/i18n_tasks_spec.rb in i18n-tasks-0.2.1
- old
+ new
@@ -4,14 +4,15 @@
describe 'rake i18n' do
describe 'missing' do
it 'detects missing or identical' do
TestCodebase.capture_stderr do
TestCodebase.rake_result('i18n:missing').should be_i18n_keys %w(
- en.used_but_missing.a en.missing_symbol_key en.relative.index.missing
+ en.used_but_missing.a en.relative.index.missing
es.missing_in_es.a es.blank_in_es.a es.same_in_es.a
+ en.missing_symbol_key en.missing_symbol.key_two en.missing_symbol.key_three
)
- end.should =~ /Missing keys and translations \(6\)/
+ end.should =~ /Missing keys and translations \(8\)/
end
end
describe 'unused' do
it 'detects unused' do
@@ -30,12 +31,18 @@
}
end
end
describe 'fill:' do
- it 'with_base' do
+ it 'add missing' do
+ TestCodebase.in_test_app_dir { YAML.load_file('config/locales/en.yml')['en']['used_but_missing'].should be_nil }
+ TestCodebase.rake_result('i18n:add_missing')
+ TestCodebase.in_test_app_dir { YAML.load_file('config/locales/en.yml')['en']['used_but_missing']['a'].should == 'A' }
+ end
+
+ it 'base_value' do
TestCodebase.in_test_app_dir { YAML.load_file('config/locales/es.yml')['es']['missing_in_es'].should be_nil }
- TestCodebase.rake_result('i18n:fill:with_base')
+ TestCodebase.rake_result('i18n:fill:base_value')
TestCodebase.in_test_app_dir {
YAML.load_file('config/locales/es.yml')['es']['missing_in_es']['a'].should == 'EN_TEXT'
YAML.load_file('config/locales/devise.en.yml')['en']['devise']['a'].should == 'EN_TEXT'
YAML.load_file('config/locales/devise.es.yml')['es']['devise']['a'].should == 'ES_TEXT'
}