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)
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)

View file

@ -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

View file

@ -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

View file

@ -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