spec/data_spec.rb in countries-4.0.1 vs spec/data_spec.rb in countries-4.1.0
- old
+ new
@@ -114,12 +114,12 @@
ISO3166.configuration.locales = [:es, :de, :de]
expect(data['name']).to eq 'NEW Taiwan'
expect(subject.name).to eq 'NEW Taiwan'
expect(subject.translations).to eq('en' => 'NEW Taiwan',
'de' => 'NEW Taiwan')
- expect(subject.subdivisions).to eq('CHA' => ISO3166::Subdivision.new({name: 'New Changhua'}),
- 'CYI' => ISO3166::Subdivision.new({name: 'New Municipality'}))
+ expect(subject.subdivisions).to eq('CHA' => ISO3166::Subdivision.new({name: 'New Changhua', code: 'CHA'}),
+ 'CYI' => ISO3166::Subdivision.new({name: 'New Municipality', code: 'CYI'}))
end
end
describe 'hotloading data' do
before do
@@ -141,11 +141,11 @@
it 'can be done' do
data = ISO3166::Data.new('LOL').call
expect(data['name']).to eq 'Happy Country'
expect(subject.name).to eq 'Happy Country'
- expect(subject.subdivisions).to eq('LOL1' => ISO3166::Subdivision.new({name: 'Happy sub1'}),
- 'LOL2' => ISO3166::Subdivision.new({name: 'Happy sub2'}))
+ expect(subject.subdivisions).to eq('LOL1' => ISO3166::Subdivision.new({name: 'Happy sub1', code: 'LOL1'}),
+ 'LOL2' => ISO3166::Subdivision.new({name: 'Happy sub2', code: 'LOL2'}))
end
it 'detect a stale cache' do
ISO3166::Data.register(alpha2: 'SAD', name: 'Sad Country')
data = ISO3166::Data.new('SAD').call