2016-12-16 10:42:34 +01:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Carto::GeoAPI::Driver do
|
2018-01-16 13:34:24 +01:00
|
|
|
describe '.regions', vcr: { cassette_name: 'geoapi_regions' } do
|
2016-12-16 10:42:34 +01:00
|
|
|
subject { described_class.regions }
|
|
|
|
|
|
|
|
it { expect(subject.code).to eq 200 }
|
|
|
|
end
|
|
|
|
|
2018-01-16 13:34:24 +01:00
|
|
|
describe '.departements', vcr: { cassette_name: 'geoapi_departements' } do
|
2016-12-16 10:42:34 +01:00
|
|
|
subject { described_class.departements }
|
|
|
|
|
|
|
|
it { expect(subject.code).to eq 200 }
|
|
|
|
end
|
|
|
|
|
|
|
|
describe '.pays' do
|
|
|
|
subject { described_class.pays }
|
|
|
|
|
|
|
|
it { is_expected.to eq File.open('app/lib/carto/geo_api/pays.json').read }
|
|
|
|
end
|
|
|
|
|
2018-03-20 16:00:30 +01:00
|
|
|
describe '.departements_url' do
|
2016-12-16 10:42:34 +01:00
|
|
|
subject { described_class.departements_url }
|
|
|
|
|
|
|
|
it { is_expected.to eq 'https://geo.api.gouv.fr/departements' }
|
|
|
|
end
|
|
|
|
|
2018-03-20 16:00:30 +01:00
|
|
|
describe '.regions_url' do
|
2016-12-16 10:42:34 +01:00
|
|
|
subject { described_class.regions_url }
|
|
|
|
|
|
|
|
it { is_expected.to eq 'https://geo.api.gouv.fr/regions' }
|
|
|
|
end
|
2017-04-04 15:27:04 +02:00
|
|
|
end
|