demarches-normaliennes/spec/lib/code_insee_spec.rb

12 lines
409 B
Ruby
Raw Permalink Normal View History

# frozen_string_literal: true
2023-10-26 11:34:55 +02:00
describe CodeInsee do
it 'converts to departement' do
expect(CodeInsee.new('75002').to_departement).to eq('75')
expect(CodeInsee.new('2B033').to_departement).to eq('2B')
expect(CodeInsee.new('01345').to_departement).to eq('01')
expect(CodeInsee.new('97100').to_departement).to eq('971')
expect(CodeInsee.new('98735').to_departement).to eq('987')
end
end