Revert "Merge pull request #4552 from tchak/champ-communes"
This reverts commit4cec26f73a
, reversing changes made to0ef25ef36c
.
This commit is contained in:
parent
c9ac7294f5
commit
4373cb22cb
63 changed files with 1119 additions and 260 deletions
46
spec/controllers/address_controller_spec.rb
Normal file
46
spec/controllers/address_controller_spec.rb
Normal file
|
@ -0,0 +1,46 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe AddressController, type: :controller do
|
||||
describe '#GET suggestions' do
|
||||
subject { get :suggestions, params: { request: request } }
|
||||
|
||||
before do
|
||||
subject
|
||||
end
|
||||
|
||||
context 'when request return result', vcr: { cassette_name: 'api_adresse_search_paris_2' } do
|
||||
let (:request) { 'Paris' }
|
||||
|
||||
it { expect(response.status).to eq 200 }
|
||||
it { expect(response.body).to eq '[{"label":"Paris"},{"label":"Paris 63120 Courpière"},{"label":"PARIS (Vaillac) 46240 Cœur de Causse"},{"label":"Paris 40500 Saint-Sever"},{"label":"Paris Buton 37140 Bourgueil"}]' }
|
||||
end
|
||||
|
||||
context 'when request return nothing', vcr: { cassette_name: 'api_adresse_search_nothing_2' } do
|
||||
let (:request) { 'je recherche pas grand chose' }
|
||||
|
||||
it { expect(response.status).to eq 200 }
|
||||
it { expect(response.body).to eq "[]" }
|
||||
end
|
||||
end
|
||||
|
||||
describe '#GET geocode' do
|
||||
let(:dossier_id) { "1" }
|
||||
subject { get :geocode, params: { request: request, dossier_id: dossier_id } }
|
||||
|
||||
before do
|
||||
subject
|
||||
end
|
||||
|
||||
context 'when request return result', vcr: { cassette_name: 'api_adresse_search_paris' } do
|
||||
let(:request) { 'Paris' }
|
||||
|
||||
it { expect(response.body).to eq ({ lon: '2.3469', lat: '48.8589', zoom: '14', dossier_id: dossier_id }).to_json }
|
||||
end
|
||||
|
||||
context 'when request return nothing', vcr: { cassette_name: 'api_adresse_search_nothing' } do
|
||||
let(:request) { 'je recherche pas grand chose' }
|
||||
|
||||
it { expect(response.body).to eq ({ lon: nil, lat: nil, zoom: '14', dossier_id: dossier_id }).to_json }
|
||||
end
|
||||
end
|
||||
end
|
|
@ -124,11 +124,6 @@ FactoryBot.define do
|
|||
value { '971 - Guadeloupe' }
|
||||
end
|
||||
|
||||
factory :champ_communes, class: 'Champs::CommuneChamp' do
|
||||
type_de_champ { create(:type_de_champ_communes) }
|
||||
value { 'Paris' }
|
||||
end
|
||||
|
||||
factory :champ_engagement, class: 'Champs::EngagementChamp' do
|
||||
type_de_champ { create(:type_de_champ_engagement) }
|
||||
value { 'true' }
|
||||
|
|
|
@ -71,9 +71,6 @@ FactoryBot.define do
|
|||
factory :type_de_champ_departements do
|
||||
type_champ { TypeDeChamp.type_champs.fetch(:departements) }
|
||||
end
|
||||
factory :type_de_champ_communes do
|
||||
type_champ { TypeDeChamp.type_champs.fetch(:communes) }
|
||||
end
|
||||
factory :type_de_champ_engagement do
|
||||
type_champ { TypeDeChamp.type_champs.fetch(:engagement) }
|
||||
end
|
||||
|
|
|
@ -10,7 +10,10 @@ feature 'The user' do
|
|||
# TODO: check
|
||||
# the order
|
||||
# there are no extraneous input
|
||||
scenario 'fill a dossier', js: true, vcr: { cassette_name: 'api_geo_departements_regions_et_communes' } do
|
||||
scenario 'fill a dossier', js: true do
|
||||
allow(Champs::RegionChamp).to receive(:regions).and_return(['region1', 'region2']).at_least(:once)
|
||||
allow(Champs::DepartementChamp).to receive(:departements).and_return(['dep1', 'dep2']).at_least(:once)
|
||||
|
||||
log_in(user, procedure)
|
||||
|
||||
fill_individual
|
||||
|
@ -30,16 +33,8 @@ feature 'The user' do
|
|||
select('val1', from: form_id_for('multiple_drop_down_list'))
|
||||
select('val3', from: form_id_for('multiple_drop_down_list'))
|
||||
select('AUSTRALIE', from: 'pays')
|
||||
|
||||
select_champ_geo('regions', 'Ma', 'Martinique')
|
||||
select('Martinique', from: 'regions')
|
||||
|
||||
select_champ_geo('departements', 'Ai', '02 - Aisne')
|
||||
select('02 - Aisne', from: 'departements')
|
||||
|
||||
select_champ_geo('communes', 'Am', 'Ambléon')
|
||||
select('Ambléon', from: 'communes')
|
||||
|
||||
select('region2', from: 'regions')
|
||||
select('dep2', from: 'departements')
|
||||
check('engagement')
|
||||
fill_in('dossier_link', with: '123')
|
||||
find('.editable-champ-piece_justificative input[type=file]').attach_file(Rails.root + 'spec/fixtures/files/file.pdf')
|
||||
|
@ -62,9 +57,8 @@ feature 'The user' do
|
|||
expect(champ_value_for('simple_drop_down_list')).to eq('val2')
|
||||
expect(JSON.parse(champ_value_for('multiple_drop_down_list'))).to match(['val1', 'val3'])
|
||||
expect(champ_value_for('pays')).to eq('AUSTRALIE')
|
||||
expect(champ_value_for('regions')).to eq('Martinique')
|
||||
expect(champ_value_for('departements')).to eq('02 - Aisne')
|
||||
expect(champ_value_for('communes')).to eq('Ambléon')
|
||||
expect(champ_value_for('regions')).to eq('region2')
|
||||
expect(champ_value_for('departements')).to eq('dep2')
|
||||
expect(champ_value_for('engagement')).to eq('on')
|
||||
expect(champ_value_for('dossier_link')).to eq('123')
|
||||
expect(champ_value_for('piece_justificative')).to be_nil # antivirus hasn't approved the file yet
|
||||
|
@ -84,9 +78,8 @@ feature 'The user' do
|
|||
expect(page).to have_selected_value('simple_drop_down_list', selected: 'val2')
|
||||
expect(page).to have_selected_value('multiple_drop_down_list', selected: ['val1', 'val3'])
|
||||
expect(page).to have_selected_value('pays', selected: 'AUSTRALIE')
|
||||
expect(page).to have_selected_value('regions', selected: 'Martinique')
|
||||
expect(page).to have_selected_value('departements', selected: '02 - Aisne')
|
||||
expect(page).to have_selected_value('communes', selected: 'Ambléon')
|
||||
expect(page).to have_selected_value('regions', selected: 'region2')
|
||||
expect(page).to have_selected_value('departement', selected: 'dep2')
|
||||
expect(page).to have_checked_field('engagement')
|
||||
expect(page).to have_field('dossier_link', with: '123')
|
||||
expect(page).to have_text('file.pdf')
|
||||
|
@ -277,12 +270,4 @@ feature 'The user' do
|
|||
expect(page).to have_selected_value("#{field}_4i", selected: date.strftime('%H'))
|
||||
expect(page).to have_selected_value("#{field}_5i", selected: date.strftime('%M'))
|
||||
end
|
||||
|
||||
def select_champ_geo(champ, fill_with, value)
|
||||
find(".editable-champ-#{champ} .select2-container").click
|
||||
id = find('.select2-container--open [role=listbox]')[:id]
|
||||
find("[aria-controls=#{id}]").fill_in with: fill_with
|
||||
expect(page).to have_content(value)
|
||||
find('li', text: value).click
|
||||
end
|
||||
end
|
||||
|
|
|
@ -77,7 +77,7 @@ feature 'Creating a new dossier:' do
|
|||
.to_return(status: 404, body: '')
|
||||
end
|
||||
|
||||
scenario 'the user can enter the SIRET of its etablissement and create a new draft' do
|
||||
scenario 'the user can enter the SIRET of its etablissement and create a new draft', vcr: { cassette_name: 'api_adresse_search_paris_3' } do
|
||||
visit commencer_path(path: procedure.path)
|
||||
click_on 'Commencer la démarche'
|
||||
|
||||
|
|
47
spec/fixtures/cassettes/api_adresse_octo.yml
vendored
Normal file
47
spec/fixtures/cassettes/api_adresse_octo.yml
vendored
Normal file
|
@ -0,0 +1,47 @@
|
|||
---
|
||||
http_interactions:
|
||||
- request:
|
||||
method: get
|
||||
uri: https://api-adresse.data.gouv.fr/search?limit=1&q=50%20av%20des%20champs%20elysees
|
||||
body:
|
||||
encoding: US-ASCII
|
||||
string: ''
|
||||
headers:
|
||||
Accept:
|
||||
- "*/*"
|
||||
Accept-Encoding:
|
||||
- gzip, deflate
|
||||
User-Agent:
|
||||
- rest-client/2.0.0 (darwin15.6.0 x86_64) ruby/2.3.1p112
|
||||
response:
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
headers:
|
||||
Server:
|
||||
- nginx/1.11.3
|
||||
Date:
|
||||
- Fri, 16 Dec 2016 16:22:23 GMT
|
||||
Content-Type:
|
||||
- application/json; charset=utf-8
|
||||
Content-Length:
|
||||
- '628'
|
||||
Connection:
|
||||
- keep-alive
|
||||
Access-Control-Allow-Origin:
|
||||
- "*"
|
||||
Access-Control-Allow-Headers:
|
||||
- X-Requested-With
|
||||
body:
|
||||
encoding: UTF-8
|
||||
string: '{"limit": 1, "attribution": "BAN", "version": "draft", "licence": "ODbL
|
||||
1.0", "query": "50 av des champs elysees", "type": "FeatureCollection", "features":
|
||||
[{"geometry": {"type": "Point", "coordinates": [2.306888, 48.870374]}, "properties":
|
||||
{"citycode": "75108", "postcode": "75008", "name": "50 Avenue des Champs \u00c9lys\u00e9es",
|
||||
"id": "ADRNIVX_0000000270748251", "type": "housenumber", "context": "75, \u00cele-de-France",
|
||||
"score": 0.7561038961038961, "label": "50 Avenue des Champs \u00c9lys\u00e9es
|
||||
75008 Paris", "city": "Paris", "housenumber": "50", "street": "Avenue des
|
||||
Champs \u00c9lys\u00e9es"}, "type": "Feature"}]}'
|
||||
http_version:
|
||||
recorded_at: Fri, 16 Dec 2016 16:22:23 GMT
|
||||
recorded_with: VCR 3.0.3
|
42
spec/fixtures/cassettes/api_adresse_search_nothing.yml
vendored
Normal file
42
spec/fixtures/cassettes/api_adresse_search_nothing.yml
vendored
Normal file
|
@ -0,0 +1,42 @@
|
|||
---
|
||||
http_interactions:
|
||||
- request:
|
||||
method: get
|
||||
uri: https://api-adresse.data.gouv.fr/search?limit=1&q=je%20recherche%20pas%20grand%20chose
|
||||
body:
|
||||
encoding: US-ASCII
|
||||
string: ''
|
||||
headers:
|
||||
Accept:
|
||||
- "*/*"
|
||||
Accept-Encoding:
|
||||
- gzip, deflate
|
||||
User-Agent:
|
||||
- rest-client/2.0.0 (darwin15.6.0 x86_64) ruby/2.3.1p112
|
||||
response:
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
headers:
|
||||
Server:
|
||||
- nginx/1.11.3
|
||||
Date:
|
||||
- Fri, 16 Dec 2016 14:17:40 GMT
|
||||
Content-Type:
|
||||
- application/json; charset=utf-8
|
||||
Content-Length:
|
||||
- '163'
|
||||
Connection:
|
||||
- keep-alive
|
||||
Access-Control-Allow-Origin:
|
||||
- "*"
|
||||
Access-Control-Allow-Headers:
|
||||
- X-Requested-With
|
||||
body:
|
||||
encoding: UTF-8
|
||||
string: '{"limit": 1, "attribution": "BAN", "version": "draft", "licence": "ODbL
|
||||
1.0", "query": "je recherche pas grand chose", "type": "FeatureCollection",
|
||||
"features": []}'
|
||||
http_version:
|
||||
recorded_at: Fri, 16 Dec 2016 14:17:40 GMT
|
||||
recorded_with: VCR 3.0.3
|
42
spec/fixtures/cassettes/api_adresse_search_nothing_2.yml
vendored
Normal file
42
spec/fixtures/cassettes/api_adresse_search_nothing_2.yml
vendored
Normal file
|
@ -0,0 +1,42 @@
|
|||
---
|
||||
http_interactions:
|
||||
- request:
|
||||
method: get
|
||||
uri: https://api-adresse.data.gouv.fr/search?limit=5&q=je%20recherche%20pas%20grand%20chose
|
||||
body:
|
||||
encoding: US-ASCII
|
||||
string: ''
|
||||
headers:
|
||||
Accept:
|
||||
- "*/*"
|
||||
Accept-Encoding:
|
||||
- gzip, deflate
|
||||
User-Agent:
|
||||
- rest-client/2.0.0 (darwin15.6.0 x86_64) ruby/2.3.1p112
|
||||
response:
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
headers:
|
||||
Server:
|
||||
- nginx/1.11.3
|
||||
Date:
|
||||
- Fri, 16 Dec 2016 16:45:53 GMT
|
||||
Content-Type:
|
||||
- application/json; charset=utf-8
|
||||
Content-Length:
|
||||
- '163'
|
||||
Connection:
|
||||
- keep-alive
|
||||
Access-Control-Allow-Origin:
|
||||
- "*"
|
||||
Access-Control-Allow-Headers:
|
||||
- X-Requested-With
|
||||
body:
|
||||
encoding: UTF-8
|
||||
string: '{"limit": 5, "attribution": "BAN", "version": "draft", "licence": "ODbL
|
||||
1.0", "query": "je recherche pas grand chose", "type": "FeatureCollection",
|
||||
"features": []}'
|
||||
http_version:
|
||||
recorded_at: Fri, 16 Dec 2016 16:45:53 GMT
|
||||
recorded_with: VCR 3.0.3
|
45
spec/fixtures/cassettes/api_adresse_search_paris.yml
vendored
Normal file
45
spec/fixtures/cassettes/api_adresse_search_paris.yml
vendored
Normal file
|
@ -0,0 +1,45 @@
|
|||
---
|
||||
http_interactions:
|
||||
- request:
|
||||
method: get
|
||||
uri: https://api-adresse.data.gouv.fr/search?limit=1&q=Paris
|
||||
body:
|
||||
encoding: US-ASCII
|
||||
string: ''
|
||||
headers:
|
||||
Accept:
|
||||
- "*/*"
|
||||
Accept-Encoding:
|
||||
- gzip, deflate
|
||||
User-Agent:
|
||||
- rest-client/2.0.0 (darwin15.6.0 x86_64) ruby/2.3.1p112
|
||||
response:
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
headers:
|
||||
Server:
|
||||
- nginx/1.11.3
|
||||
Date:
|
||||
- Fri, 16 Dec 2016 14:16:43 GMT
|
||||
Content-Type:
|
||||
- application/json; charset=utf-8
|
||||
Content-Length:
|
||||
- '457'
|
||||
Connection:
|
||||
- keep-alive
|
||||
Access-Control-Allow-Origin:
|
||||
- "*"
|
||||
Access-Control-Allow-Headers:
|
||||
- X-Requested-With
|
||||
body:
|
||||
encoding: UTF-8
|
||||
string: '{"limit": 1, "attribution": "BAN", "version": "draft", "licence": "ODbL
|
||||
1.0", "query": "Paris", "type": "FeatureCollection", "features": [{"geometry":
|
||||
{"type": "Point", "coordinates": [2.3469, 48.8589]}, "properties": {"adm_weight":
|
||||
"6", "citycode": "75056", "name": "Paris", "city": "Paris", "postcode": "75000",
|
||||
"context": "75, \u00cele-de-France", "score": 1.0, "label": "Paris", "id":
|
||||
"75056", "type": "city", "population": "2244"}, "type": "Feature"}]}'
|
||||
http_version:
|
||||
recorded_at: Fri, 16 Dec 2016 14:16:43 GMT
|
||||
recorded_with: VCR 3.0.3
|
63
spec/fixtures/cassettes/api_adresse_search_paris_2.yml
vendored
Normal file
63
spec/fixtures/cassettes/api_adresse_search_paris_2.yml
vendored
Normal file
|
@ -0,0 +1,63 @@
|
|||
---
|
||||
http_interactions:
|
||||
- request:
|
||||
method: get
|
||||
uri: https://api-adresse.data.gouv.fr/search?limit=5&q=Paris
|
||||
body:
|
||||
encoding: US-ASCII
|
||||
string: ''
|
||||
headers:
|
||||
Accept:
|
||||
- "*/*"
|
||||
Accept-Encoding:
|
||||
- gzip, deflate
|
||||
User-Agent:
|
||||
- rest-client/2.0.0 (darwin15.6.0 x86_64) ruby/2.3.1p112
|
||||
response:
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
headers:
|
||||
Server:
|
||||
- nginx/1.11.3
|
||||
Date:
|
||||
- Fri, 16 Dec 2016 16:43:34 GMT
|
||||
Content-Type:
|
||||
- application/json; charset=utf-8
|
||||
Content-Length:
|
||||
- '1887'
|
||||
Connection:
|
||||
- keep-alive
|
||||
Access-Control-Allow-Origin:
|
||||
- "*"
|
||||
Access-Control-Allow-Headers:
|
||||
- X-Requested-With
|
||||
body:
|
||||
encoding: UTF-8
|
||||
string: '{"limit": 5, "attribution": "BAN", "version": "draft", "licence": "ODbL
|
||||
1.0", "query": "Paris", "type": "FeatureCollection", "features": [{"geometry":
|
||||
{"type": "Point", "coordinates": [2.3469, 48.8589]}, "properties": {"adm_weight":
|
||||
"6", "citycode": "75056", "name": "Paris", "city": "Paris", "postcode": "75000",
|
||||
"context": "75, \u00cele-de-France", "score": 1.0, "label": "Paris", "id":
|
||||
"75056", "type": "city", "population": "2244"}, "type": "Feature"}, {"geometry":
|
||||
{"type": "Point", "coordinates": [3.564293, 45.766413]}, "properties": {"citycode":
|
||||
"63125", "postcode": "63120", "name": "Paris", "city": "Courpi\u00e8re", "context":
|
||||
"63, Puy-de-D\u00f4me, Auvergne", "score": 0.8255363636363636, "label": "Paris
|
||||
63120 Courpi\u00e8re", "id": "63125_B221_03549b", "type": "locality"}, "type":
|
||||
"Feature"}, {"geometry": {"type": "Point", "coordinates": [1.550208, 44.673592]},
|
||||
"properties": {"citycode": "46138", "postcode": "46240", "name": "PARIS (Vaillac)",
|
||||
"city": "C\u0153ur de Causse", "context": "46, Lot, Midi-Pyr\u00e9n\u00e9es",
|
||||
"score": 0.824090909090909, "label": "PARIS (Vaillac) 46240 C\u0153ur de Causse",
|
||||
"id": "46138_XXXX_6ee4ec", "type": "street"}, "type": "Feature"}, {"geometry":
|
||||
{"type": "Point", "coordinates": [-0.526884, 43.762253]}, "properties": {"citycode":
|
||||
"40282", "postcode": "40500", "name": "Paris", "city": "Saint-Sever", "context":
|
||||
"40, Landes, Aquitaine", "score": 0.8236181818181818, "label": "Paris 40500
|
||||
Saint-Sever", "id": "40282_B237_2364e3", "type": "locality"}, "type": "Feature"},
|
||||
{"geometry": {"type": "Point", "coordinates": [0.157613, 47.336685]}, "properties":
|
||||
{"citycode": "37031", "postcode": "37140", "name": "Paris Buton", "city":
|
||||
"Bourgueil", "context": "37, Indre-et-Loire, Centre Val-de-Loire", "score":
|
||||
0.8235454545454545, "label": "Paris Buton 37140 Bourgueil", "id": "37031_X027_0a5e7a",
|
||||
"type": "locality"}, "type": "Feature"}]}'
|
||||
http_version:
|
||||
recorded_at: Fri, 16 Dec 2016 16:43:34 GMT
|
||||
recorded_with: VCR 3.0.3
|
93
spec/fixtures/cassettes/api_adresse_search_paris_3.yml
vendored
Normal file
93
spec/fixtures/cassettes/api_adresse_search_paris_3.yml
vendored
Normal file
|
@ -0,0 +1,93 @@
|
|||
---
|
||||
http_interactions:
|
||||
- request:
|
||||
method: get
|
||||
uri: https://api-adresse.data.gouv.fr/search?limit=1&q=50%20AV%20DES%20CHAMPS%20ELYSEES%20complement_adresse%2075008%20PARIS%208
|
||||
body:
|
||||
encoding: US-ASCII
|
||||
string: ''
|
||||
headers:
|
||||
Accept:
|
||||
- "*/*"
|
||||
Accept-Encoding:
|
||||
- gzip, deflate
|
||||
User-Agent:
|
||||
- rest-client/2.0.0 (darwin15.6.0 x86_64) ruby/2.3.1p112
|
||||
response:
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
headers:
|
||||
Server:
|
||||
- nginx/1.11.3
|
||||
Date:
|
||||
- Tue, 03 Jan 2017 13:00:54 GMT
|
||||
Content-Type:
|
||||
- application/json; charset=utf-8
|
||||
Content-Length:
|
||||
- '660'
|
||||
Connection:
|
||||
- keep-alive
|
||||
Access-Control-Allow-Origin:
|
||||
- "*"
|
||||
Access-Control-Allow-Headers:
|
||||
- X-Requested-With
|
||||
body:
|
||||
encoding: UTF-8
|
||||
string: '{"limit": 1, "attribution": "BAN", "version": "draft", "licence": "ODbL
|
||||
1.0", "query": "50 AV DES CHAMPS ELYSEES complement_adresse 75008 PARIS 8",
|
||||
"type": "FeatureCollection", "features": [{"geometry": {"type": "Point", "coordinates":
|
||||
[2.306888, 48.870374]}, "properties": {"citycode": "75108", "postcode": "75008",
|
||||
"name": "50 Avenue des Champs \u00c9lys\u00e9es", "id": "ADRNIVX_0000000270748251",
|
||||
"type": "housenumber", "context": "75, \u00cele-de-France", "score": 0.596517719568567,
|
||||
"label": "50 Avenue des Champs \u00c9lys\u00e9es 75008 Paris", "city": "Paris",
|
||||
"housenumber": "50", "street": "Avenue des Champs \u00c9lys\u00e9es"}, "type":
|
||||
"Feature"}]}'
|
||||
http_version:
|
||||
recorded_at: Tue, 03 Jan 2017 13:00:54 GMT
|
||||
- request:
|
||||
method: get
|
||||
uri: http://api-adresse.data.gouv.fr/search?limit=1&q=50%20AV%20DES%20CHAMPS%20ELYSEES%20complement_adresse%2075008%20PARIS%208
|
||||
body:
|
||||
encoding: US-ASCII
|
||||
string: ''
|
||||
headers:
|
||||
Accept:
|
||||
- "*/*"
|
||||
Accept-Encoding:
|
||||
- gzip, deflate
|
||||
User-Agent:
|
||||
- rest-client/2.0.0 (darwin15.6.0 x86_64) ruby/2.3.1p112
|
||||
response:
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
headers:
|
||||
Server:
|
||||
- nginx/1.11.3
|
||||
Date:
|
||||
- Tue, 03 Jan 2017 13:00:55 GMT
|
||||
Content-Type:
|
||||
- application/json; charset=utf-8
|
||||
Content-Length:
|
||||
- '660'
|
||||
Connection:
|
||||
- keep-alive
|
||||
Access-Control-Allow-Origin:
|
||||
- "*"
|
||||
Access-Control-Allow-Headers:
|
||||
- X-Requested-With
|
||||
body:
|
||||
encoding: UTF-8
|
||||
string: '{"limit": 1, "attribution": "BAN", "version": "draft", "licence": "ODbL
|
||||
1.0", "query": "50 AV DES CHAMPS ELYSEES complement_adresse 75008 PARIS 8",
|
||||
"type": "FeatureCollection", "features": [{"geometry": {"type": "Point", "coordinates":
|
||||
[2.306888, 48.870374]}, "properties": {"citycode": "75108", "postcode": "75008",
|
||||
"name": "50 Avenue des Champs \u00c9lys\u00e9es", "id": "ADRNIVX_0000000270748251",
|
||||
"type": "housenumber", "context": "75, \u00cele-de-France", "score": 0.596517719568567,
|
||||
"label": "50 Avenue des Champs \u00c9lys\u00e9es 75008 Paris", "city": "Paris",
|
||||
"housenumber": "50", "street": "Avenue des Champs \u00c9lys\u00e9es"}, "type":
|
||||
"Feature"}]}'
|
||||
http_version:
|
||||
recorded_at: Tue, 03 Jan 2017 13:00:55 GMT
|
||||
recorded_with: VCR 3.0.3
|
51
spec/fixtures/cassettes/api_geo_departements.yml
vendored
Normal file
51
spec/fixtures/cassettes/api_geo_departements.yml
vendored
Normal file
|
@ -0,0 +1,51 @@
|
|||
---
|
||||
http_interactions:
|
||||
- request:
|
||||
method: get
|
||||
uri: https://geo.api.gouv.fr/departements?fields=nom
|
||||
body:
|
||||
encoding: US-ASCII
|
||||
string: ''
|
||||
headers:
|
||||
User-Agent:
|
||||
- demarches-simplifiees.fr
|
||||
Accept:
|
||||
- application/json
|
||||
Accept-Encoding:
|
||||
- gzip, deflate
|
||||
Expect:
|
||||
- ''
|
||||
response:
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
headers:
|
||||
Server:
|
||||
- nginx/1.10.3 (Ubuntu)
|
||||
Date:
|
||||
- Tue, 23 Oct 2018 13:11:36 GMT
|
||||
Content-Type:
|
||||
- application/json; charset=utf-8
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
Connection:
|
||||
- keep-alive
|
||||
Vary:
|
||||
- Accept-Encoding
|
||||
X-Powered-By:
|
||||
- Express
|
||||
Access-Control-Allow-Origin:
|
||||
- "*"
|
||||
Etag:
|
||||
- W/"cc1-jlb3C7xpXUEaq56Wojrp9rAkoH8"
|
||||
Strict-Transport-Security:
|
||||
- max-age=15552000
|
||||
Content-Encoding:
|
||||
- gzip
|
||||
body:
|
||||
encoding: ASCII-8BIT
|
||||
string: !binary |-
|
||||
W3sibm9tIjoiQWluIiwiY29kZSI6IjAxIn0seyJub20iOiJBaXNuZSIsImNvZGUiOiIwMiJ9LHsibm9tIjoiQWxsaWVyIiwiY29kZSI6IjAzIn0seyJub20iOiJBbHBlcy1kZS1IYXV0ZS1Qcm92ZW5jZSIsImNvZGUiOiIwNCJ9LHsibm9tIjoiSGF1dGVzLUFscGVzIiwiY29kZSI6IjA1In0seyJub20iOiJBbHBlcy1NYXJpdGltZXMiLCJjb2RlIjoiMDYifSx7Im5vbSI6IkFyZMOoY2hlIiwiY29kZSI6IjA3In0seyJub20iOiJBcmRlbm5lcyIsImNvZGUiOiIwOCJ9LHsibm9tIjoiQXJpw6hnZSIsImNvZGUiOiIwOSJ9LHsibm9tIjoiQXViZSIsImNvZGUiOiIxMCJ9LHsibm9tIjoiQXVkZSIsImNvZGUiOiIxMSJ9LHsibm9tIjoiQXZleXJvbiIsImNvZGUiOiIxMiJ9LHsibm9tIjoiQm91Y2hlcy1kdS1SaMO0bmUiLCJjb2RlIjoiMTMifSx7Im5vbSI6IkNhbHZhZG9zIiwiY29kZSI6IjE0In0seyJub20iOiJDYW50YWwiLCJjb2RlIjoiMTUifSx7Im5vbSI6IkNoYXJlbnRlIiwiY29kZSI6IjE2In0seyJub20iOiJDaGFyZW50ZS1NYXJpdGltZSIsImNvZGUiOiIxNyJ9LHsibm9tIjoiQ2hlciIsImNvZGUiOiIxOCJ9LHsibm9tIjoiQ29ycsOoemUiLCJjb2RlIjoiMTkifSx7Im5vbSI6IkPDtHRlLWQnT3IiLCJjb2RlIjoiMjEifSx7Im5vbSI6IkPDtHRlcy1kJ0FybW9yIiwiY29kZSI6IjIyIn0seyJub20iOiJDcmV1c2UiL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YWRlbG91cGUiLCJjb2RlIjoiOTcxIn0seyJub20iOiJNYXJ0aW5pcXVlIiwiY29kZSI6Ijk3MiJ9LHsibm9tIjoiR3V5YW5lIiwiY29kZSI6Ijk3MyJ9LHsibm9tIjoiTGEgUsOpdW5pb24iLCJjb2RlIjoiOTc0In0seyJub20iOiJNYXlvdHRlIiwiY29kZSI6Ijk3NiJ9XQ==
|
||||
http_version:
|
||||
recorded_at: Tue, 23 Oct 2018 13:11:36 GMT
|
||||
recorded_with: VCR 4.0.0
|
51
spec/fixtures/cassettes/api_geo_regions.yml
vendored
Normal file
51
spec/fixtures/cassettes/api_geo_regions.yml
vendored
Normal file
|
@ -0,0 +1,51 @@
|
|||
---
|
||||
http_interactions:
|
||||
- request:
|
||||
method: get
|
||||
uri: https://geo.api.gouv.fr/regions?fields=nom
|
||||
body:
|
||||
encoding: US-ASCII
|
||||
string: ''
|
||||
headers:
|
||||
User-Agent:
|
||||
- demarches-simplifiees.fr
|
||||
Accept:
|
||||
- application/json
|
||||
Accept-Encoding:
|
||||
- gzip, deflate
|
||||
Expect:
|
||||
- ''
|
||||
response:
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
headers:
|
||||
Server:
|
||||
- nginx/1.10.3 (Ubuntu)
|
||||
Date:
|
||||
- Tue, 23 Oct 2018 13:11:36 GMT
|
||||
Content-Type:
|
||||
- application/json; charset=utf-8
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
Connection:
|
||||
- keep-alive
|
||||
Vary:
|
||||
- Accept-Encoding
|
||||
X-Powered-By:
|
||||
- Express
|
||||
Access-Control-Allow-Origin:
|
||||
- "*"
|
||||
Etag:
|
||||
- W/"28d-5OgIzgwL+0K2UaO0foKduqMMBrA"
|
||||
Strict-Transport-Security:
|
||||
- max-age=15552000
|
||||
Content-Encoding:
|
||||
- gzip
|
||||
body:
|
||||
encoding: ASCII-8BIT
|
||||
string: !binary |-
|
||||
W3sibm9tIjoiR3VhZGVsb3VwZSIsImNvZGUiOiIwMSJ9LHsibm9tIjoiTWFydGluaXF1ZSIsImNvZGUiOiIwMiJ9LHsibm9tIjoiR3V5YW5lIiwiY29kZSI6IjAzIn0seyJub20iOiJMYSBSw6l1bmlvbiIsImNvZGUiOiIwNCJ9LHsibm9tIjoiTWF5b3R0ZSIsImNvZGUiOiIwNiJ9LHsibm9tIjoiw45sZS1kZS1GcmFuY2UiLCJjb2RlIjoiMTEifSx7Im5vbSI6IkNlbnRyZS1WYWwgZGUgTG9pcmUiLCJjb2RlIjoiMjQifSx7Im5vbSI6IkJvdXJnb2duZS1GcmFuY2hlLUNvbXTDqSIsImNvZGUiOiIyNyJ9LHsibm9tIjoiTm9ybWFuZGllIiwiY29kZSI6IjI4In0seyJub20iOiJIYXV0cy1kZS1GcmFuY2UiLCJjb2RlIjoiMzIifSx7Im5vbSI6IkdyYW5kIEVzdCIsImNvZGUiOiI0NCJ9LHsibm9tIjoiUGF5cyBkZSBsYSBMb2lyZSIsImNvZGUiOiI1MiJ9LHsibm9tIjoiQnJldGFnbmUiLCJjb2RlIjoiNTMifSx7Im5vbSI6Ik5vdXZlbGxlLUFxdWl0YWluZSIsImNvZGUiOiI3NSJ9LHsibm9tIjoiT2NjaXRhbmllIiwiY29kZSI6Ijc2In0seyJub20iOiJBdXZlcmduZS1SaMO0bmUtQWxwZXMiLCJjb2RlIjoiODQifSx7Im5vbSI6IlByb3ZlbmNlLUFscGVzLUPDtHRlIGQnQXp1ciIsImNvZGUiOiI5MyJ9LHsibm9tIjoiQ29yc2UiLCJjb2RlIjoiOTQifV0=
|
||||
http_version:
|
||||
recorded_at: Tue, 23 Oct 2018 13:11:36 GMT
|
||||
recorded_with: VCR 4.0.0
|
51
spec/fixtures/cassettes/api_geo_search_rpg.yml
vendored
Normal file
51
spec/fixtures/cassettes/api_geo_search_rpg.yml
vendored
Normal file
File diff suppressed because one or more lines are too long
44
spec/lib/api_adresse/address_adapter_spec.rb
Normal file
44
spec/lib/api_adresse/address_adapter_spec.rb
Normal file
|
@ -0,0 +1,44 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe ApiAdresse::AddressAdapter do
|
||||
describe '#get_suggestions' do
|
||||
let(:request) { 'Paris' }
|
||||
let(:response) { File.open('spec/fixtures/files/api_adresse/search_results.json') }
|
||||
let(:status) { 200 }
|
||||
|
||||
subject { described_class.new(request).get_suggestions }
|
||||
|
||||
before do
|
||||
stub_request(:get, "https://api-adresse.data.gouv.fr/search?&q=#{request}&limit=5")
|
||||
.to_return(status: status, body: response, headers: {})
|
||||
end
|
||||
|
||||
context 'when address return a list of address' do
|
||||
it { expect(subject.size).to eq 5 }
|
||||
it { is_expected.to be_an_instance_of Array }
|
||||
end
|
||||
|
||||
context 'when address return an empty list' do
|
||||
let(:response) { File.open('spec/fixtures/files/api_adresse/search_no_results.json') }
|
||||
|
||||
it { expect(subject.size).to eq 0 }
|
||||
it { is_expected.to be_an_instance_of Array }
|
||||
end
|
||||
|
||||
context 'when BAN is unavailable' do
|
||||
let(:status) { 503 }
|
||||
let(:response) { '' }
|
||||
|
||||
it { expect(subject.size).to eq 0 }
|
||||
it { is_expected.to be_an_instance_of Array }
|
||||
end
|
||||
|
||||
context 'when request is empty' do
|
||||
let(:response) { 'Missing query' }
|
||||
let(:request) { '' }
|
||||
|
||||
it { expect(subject.size).to eq 0 }
|
||||
it { is_expected.to be_an_instance_of Array }
|
||||
end
|
||||
end
|
||||
end
|
31
spec/lib/api_adresse/point_adapter_spec.rb
Normal file
31
spec/lib/api_adresse/point_adapter_spec.rb
Normal file
|
@ -0,0 +1,31 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe ApiAdresse::PointAdapter do
|
||||
let(:address) { '50 av des champs elysees' }
|
||||
|
||||
describe '.geocode', vcr: { cassette_name: 'api_adresse_octo' } do
|
||||
it 'return a point' do
|
||||
expect(described_class.new(address).geocode.class).to eq(RGeo::Cartesian::PointImpl)
|
||||
end
|
||||
|
||||
context 'when RestClient::Exception' do
|
||||
before do
|
||||
allow(ApiAdresse::API).to receive(:call).and_raise(RestClient::Exception)
|
||||
end
|
||||
|
||||
it 'return nil' do
|
||||
expect(described_class.new(address).geocode).to be_nil
|
||||
end
|
||||
end
|
||||
|
||||
context 'when JSON::ParserError' do
|
||||
before do
|
||||
allow(JSON).to receive(:parse).and_raise(JSON::ParserError)
|
||||
end
|
||||
|
||||
it 'return nil' do
|
||||
expect(described_class.new(address).geocode).to be_nil
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
75
spec/lib/api_geo/api_spec.rb
Normal file
75
spec/lib/api_geo/api_spec.rb
Normal file
|
@ -0,0 +1,75 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe ApiGeo::API do
|
||||
describe '.regions', vcr: { cassette_name: 'api_geo_regions' } do
|
||||
subject { described_class.regions }
|
||||
|
||||
it { expect(subject.size).to eq 18 }
|
||||
end
|
||||
|
||||
describe '.departements', vcr: { cassette_name: 'api_geo_departements' } do
|
||||
subject { described_class.departements }
|
||||
|
||||
it { expect(subject.size).to eq 101 }
|
||||
end
|
||||
|
||||
describe '.pays' do
|
||||
subject { described_class.pays }
|
||||
let(:pays) {
|
||||
JSON.parse(File.open('app/lib/api_geo/pays.json').read, symbolize_names: true)
|
||||
}
|
||||
|
||||
it { is_expected.to eq pays }
|
||||
end
|
||||
|
||||
describe '.search_rpg', vcr: { cassette_name: 'api_geo_search_rpg' } do
|
||||
let(:coordinates) do
|
||||
[
|
||||
[
|
||||
2.3945903778076176,
|
||||
46.53312237252731
|
||||
],
|
||||
[
|
||||
2.394933700561524,
|
||||
46.532590956418076
|
||||
],
|
||||
[
|
||||
2.3948478698730473,
|
||||
46.53170525134736
|
||||
],
|
||||
[
|
||||
2.393732070922852,
|
||||
46.530760483351195
|
||||
],
|
||||
[
|
||||
2.3909854888916016,
|
||||
46.5309376286023
|
||||
],
|
||||
[
|
||||
2.391414642333985,
|
||||
46.531232869403546
|
||||
],
|
||||
[
|
||||
2.3913288116455083,
|
||||
46.53253190986272
|
||||
],
|
||||
[
|
||||
2.39278793334961,
|
||||
46.53329951007484
|
||||
],
|
||||
[
|
||||
2.3945903778076176,
|
||||
46.53312237252731
|
||||
]
|
||||
]
|
||||
end
|
||||
|
||||
let(:geo_json) {
|
||||
GeojsonService.to_json_polygon_for_rpg(coordinates)
|
||||
}
|
||||
|
||||
subject { described_class.search_rpg(geo_json) }
|
||||
|
||||
it { expect(subject[:features].size).to eq 3 }
|
||||
end
|
||||
end
|
62
spec/lib/api_geo/rpg_adapter_spec.rb
Normal file
62
spec/lib/api_geo/rpg_adapter_spec.rb
Normal file
|
@ -0,0 +1,62 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe ApiGeo::RPGAdapter do
|
||||
subject { described_class.new(coordinates).results }
|
||||
|
||||
let(:coordinates) do
|
||||
[
|
||||
[
|
||||
2.3945903778076176,
|
||||
46.53312237252731
|
||||
],
|
||||
[
|
||||
2.394933700561524,
|
||||
46.532590956418076
|
||||
],
|
||||
[
|
||||
2.3948478698730473,
|
||||
46.53170525134736
|
||||
],
|
||||
[
|
||||
2.393732070922852,
|
||||
46.530760483351195
|
||||
],
|
||||
[
|
||||
2.3909854888916016,
|
||||
46.5309376286023
|
||||
],
|
||||
[
|
||||
2.391414642333985,
|
||||
46.531232869403546
|
||||
],
|
||||
[
|
||||
2.3913288116455083,
|
||||
46.53253190986272
|
||||
],
|
||||
[
|
||||
2.39278793334961,
|
||||
46.53329951007484
|
||||
],
|
||||
[
|
||||
2.3945903778076176,
|
||||
46.53312237252731
|
||||
]
|
||||
]
|
||||
end
|
||||
|
||||
context 'coordinates are filled', vcr: { cassette_name: 'api_geo_search_rpg' } do
|
||||
describe 'Attribut filter' do
|
||||
it { expect(subject.size).to eq(3) }
|
||||
it do
|
||||
expect(subject.first.keys).to eq([
|
||||
:culture,
|
||||
:code_culture,
|
||||
:surface,
|
||||
:bio,
|
||||
:geometry,
|
||||
:geo_reference_id
|
||||
])
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -32,6 +32,12 @@ shared_examples 'champ_spec' do
|
|||
end
|
||||
end
|
||||
|
||||
describe '.departement', vcr: { cassette_name: 'api_geo_departements' } do
|
||||
subject { Champs::DepartementChamp.departements }
|
||||
|
||||
it { expect(subject).to include '99 - Étranger' }
|
||||
end
|
||||
|
||||
context "when type_champ=date" do
|
||||
let(:type_de_champ) { create(:type_de_champ_date) }
|
||||
let(:champ) { type_de_champ.champ.create }
|
||||
|
|
|
@ -69,7 +69,6 @@ describe ProcedureExportService do
|
|||
"pays",
|
||||
"regions",
|
||||
"departements",
|
||||
"communes",
|
||||
"engagement",
|
||||
"dossier_link",
|
||||
"piece_justificative",
|
||||
|
@ -143,7 +142,6 @@ describe ProcedureExportService do
|
|||
"pays",
|
||||
"regions",
|
||||
"departements",
|
||||
"communes",
|
||||
"engagement",
|
||||
"dossier_link",
|
||||
"piece_justificative",
|
||||
|
@ -222,7 +220,6 @@ describe ProcedureExportService do
|
|||
"pays",
|
||||
"regions",
|
||||
"departements",
|
||||
"communes",
|
||||
"engagement",
|
||||
"dossier_link",
|
||||
"piece_justificative",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue