diff --git a/app/controllers/ban/search_controller.rb b/app/controllers/ban/search_controller.rb index 70cc7d9c7..1476ec9fe 100644 --- a/app/controllers/ban/search_controller.rb +++ b/app/controllers/ban/search_controller.rb @@ -10,7 +10,7 @@ class Ban::SearchController < ApplicationController end def get_address_point - point = Carto::Geocodeur.convert_adresse_to_point(params[:request]) + point = ApiAdresse::Geocodeur.convert_adresse_to_point(params[:request]) if point.present? lon = point.x.to_s diff --git a/app/lib/carto/geocodeur.rb b/app/lib/api_adresse/geocodeur.rb similarity index 94% rename from app/lib/carto/geocodeur.rb rename to app/lib/api_adresse/geocodeur.rb index 33ddf7548..04b7c5cb2 100644 --- a/app/lib/carto/geocodeur.rb +++ b/app/lib/api_adresse/geocodeur.rb @@ -1,4 +1,4 @@ -module Carto +module ApiAdresse # this class take a string in input and return a point class Geocodeur def self.convert_adresse_to_point(address) diff --git a/app/models/dossier.rb b/app/models/dossier.rb index e5d832151..c7678231b 100644 --- a/app/models/dossier.rb +++ b/app/models/dossier.rb @@ -243,7 +243,7 @@ class Dossier < ApplicationRecord def geo_position if etablissement.present? - point = Carto::Geocodeur.convert_adresse_to_point(etablissement.geo_adresse) + point = ApiAdresse::Geocodeur.convert_adresse_to_point(etablissement.geo_adresse) end lon = "2.428462" diff --git a/spec/lib/carto/geocodeur_spec.rb b/spec/lib/api_adresse/geocodeur_spec.rb similarity index 96% rename from spec/lib/carto/geocodeur_spec.rb rename to spec/lib/api_adresse/geocodeur_spec.rb index 1df8adad8..39a2f724a 100644 --- a/spec/lib/carto/geocodeur_spec.rb +++ b/spec/lib/api_adresse/geocodeur_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Carto::Geocodeur do +describe ApiAdresse::Geocodeur do let(:address) { '50 av des champs elysees' } describe '.convert_adresse_to_point', vcr: { cassette_name: 'api_adresse_octo' } do it 'return a point' do