spec/configuration_spec.rb in countries-2.0.0.pre.2 vs spec/configuration_spec.rb in countries-2.0.0.pre.3
- old
+ new
@@ -6,10 +6,13 @@
expect(ISO3166.configuration).to be_a ISO3166::Configuration
end
it 'locales can be changed' do
ISO3166.configuration.locales = [:es]
- expect(ISO3166.configuration.locales).to eq [:es]
+ ISO3166.configuration.locales << :de
+ expect(ISO3166::Country.new('DE').translation(:de)).to eq 'Deutschland'
+ expect(ISO3166::Country.new('DE').translation(:es)).to eq 'Alemania'
+ expect(ISO3166::Country.new('DE').translation(:en)).to eq nil
end
it 'locales are assumed from I18n.available_locales' do
I18n.available_locales = [:de, :en]
ISO3166.reset