spec/i18n_tasks_spec.rb in i18n-tasks-0.1.6 vs spec/i18n_tasks_spec.rb in i18n-tasks-0.1.7

- old
+ new

@@ -17,14 +17,18 @@ end.should =~ /Unused i18n keys \(3\)/ end end describe 'prefill' do - it 'detects unused' do + it 'prefills from en' do TestCodebase.in_test_app_dir { YAML.load_file('config/locales/es.yml')['es']['missing_in_es'].should be_nil } TestCodebase.rake_result('i18n:prefill') - TestCodebase.in_test_app_dir { YAML.load_file('config/locales/es.yml')['es']['missing_in_es']['a'].should == 'EN_TEXT' } + 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' + } end end # --- setup --- BENCH_KEYS = 30 @@ -43,10 +47,11 @@ 'ignore_eq_base_all' => {'a' => v}, 'ignore_eq_base_es' => {'a' => v}, 'blank_in_es' => {'a' => v}, 'relative' => {'index' => {'title' => v}}, 'numeric' => {'a' => v_num}, - 'plural' => {'a' => {'one' => v, 'other' => "%{count} #{v}s"}} + 'plural' => {'a' => {'one' => v, 'other' => "%{count} #{v}s"}}, + 'devise' => {'a' => v} }.tap { |r| gen = r["bench"] = {} BENCH_KEYS.times { |i| gen["key#{i}"] = v } } }