Use round brackets

This commit is contained in:
gregoirenovel 2018-10-15 15:48:01 +02:00
parent 0196309822
commit 2ed4c1da1c
4 changed files with 9 additions and 9 deletions

View file

@ -19,8 +19,8 @@ class Users::CarteController < UsersController
dossier.cadastres.each(&:destroy) dossier.cadastres.each(&:destroy)
if geo_json.present? if geo_json.present?
ModuleApiCartoService.save_qp! dossier, geo_json ModuleApiCartoService.save_qp!(dossier, geo_json)
ModuleApiCartoService.save_cadastre! dossier, geo_json ModuleApiCartoService.save_cadastre!(dossier, geo_json)
end end
dossier.update!(json_latlngs: geo_json) dossier.update!(json_latlngs: geo_json)

View file

@ -20,7 +20,7 @@ class CARTO::SGMAP::API
RestClient::Resource.new( RestClient::Resource.new(
url, url,
verify_ssl: verify_ssl_mode verify_ssl: verify_ssl_mode
).post params[:geojson], content_type: 'application/json' ).post(params[:geojson], content_type: 'application/json')
rescue RestClient::InternalServerError rescue RestClient::InternalServerError
raise RestClient::ResourceNotFound raise RestClient::ResourceNotFound

View file

@ -1,7 +1,7 @@
class ModuleApiCartoService class ModuleApiCartoService
def self.save_qp!(dossier, json_latlngs) def self.save_qp!(dossier, json_latlngs)
if dossier.procedure.module_api_carto.quartiers_prioritaires? 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_list.each_value do |qp|
qp[:dossier_id] = dossier.id qp[:dossier_id] = dossier.id

View file

@ -16,15 +16,15 @@ describe CARTO::SGMAP::Cadastre::Adapter do
let(:body) { File.read('spec/support/files/geojson/response_cadastre.json') } let(:body) { File.read('spec/support/files/geojson/response_cadastre.json') }
it { expect(subject).to be_a_instance_of(Array) } 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 describe 'Attribut filter' do
let(:adapter) { described_class.new(coordinates) } 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 it do
expect(subject.keys).to eq [ expect(subject.keys).to eq([
:surface_intersection, :surface_intersection,
:surface_parcelle, :surface_parcelle,
:numero, :numero,
@ -34,7 +34,7 @@ describe CARTO::SGMAP::Cadastre::Adapter do
:nom_com, :nom_com,
:code_com, :code_com,
:code_arr :code_arr
] ])
end end
end end