diff --git a/app/controllers/users/carte_controller.rb b/app/controllers/users/carte_controller.rb index 8e556cf7f..751cb736a 100644 --- a/app/controllers/users/carte_controller.rb +++ b/app/controllers/users/carte_controller.rb @@ -19,8 +19,8 @@ class Users::CarteController < UsersController dossier.cadastres.each(&:destroy) if geo_json.present? - ModuleApiCartoService.save_qp! dossier, geo_json - ModuleApiCartoService.save_cadastre! dossier, geo_json + ModuleApiCartoService.save_qp!(dossier, geo_json) + ModuleApiCartoService.save_cadastre!(dossier, geo_json) end dossier.update!(json_latlngs: geo_json) diff --git a/app/lib/carto/sgmap/api.rb b/app/lib/carto/sgmap/api.rb index c5021b838..16cd69556 100644 --- a/app/lib/carto/sgmap/api.rb +++ b/app/lib/carto/sgmap/api.rb @@ -20,7 +20,7 @@ class CARTO::SGMAP::API RestClient::Resource.new( url, verify_ssl: verify_ssl_mode - ).post params[:geojson], content_type: 'application/json' + ).post(params[:geojson], content_type: 'application/json') rescue RestClient::InternalServerError raise RestClient::ResourceNotFound diff --git a/app/services/module_api_carto_service.rb b/app/services/module_api_carto_service.rb index 50206bf64..39ecd2b53 100644 --- a/app/services/module_api_carto_service.rb +++ b/app/services/module_api_carto_service.rb @@ -1,7 +1,7 @@ class ModuleApiCartoService def self.save_qp!(dossier, json_latlngs) if dossier.procedure.module_api_carto.quartiers_prioritaires? - qp_list = generate_qp JSON.parse(json_latlngs) + qp_list = generate_qp(JSON.parse(json_latlngs)) qp_list.each_value do |qp| qp[:dossier_id] = dossier.id diff --git a/spec/lib/carto/sgmap/cadastre/adapter_spec.rb b/spec/lib/carto/sgmap/cadastre/adapter_spec.rb index c061eec44..f5ed9e307 100644 --- a/spec/lib/carto/sgmap/cadastre/adapter_spec.rb +++ b/spec/lib/carto/sgmap/cadastre/adapter_spec.rb @@ -16,15 +16,15 @@ describe CARTO::SGMAP::Cadastre::Adapter do let(:body) { File.read('spec/support/files/geojson/response_cadastre.json') } it { expect(subject).to be_a_instance_of(Array) } - it { expect(subject.size).to eq 16 } + it { expect(subject.size).to eq(16) } describe 'Attribut filter' do let(:adapter) { described_class.new(coordinates) } - subject { adapter.filter_properties adapter.data_source } + subject { adapter.filter_properties(adapter.data_source) } - it { expect(subject.size).to eq 9 } + it { expect(subject.size).to eq(9) } it do - expect(subject.keys).to eq [ + expect(subject.keys).to eq([ :surface_intersection, :surface_parcelle, :numero, @@ -34,7 +34,7 @@ describe CARTO::SGMAP::Cadastre::Adapter do :nom_com, :code_com, :code_arr - ] + ]) end end