ApiAdresse::PointRetriever → ApiAdresse::PointAdapter
This commit is contained in:
parent
81d2b27160
commit
af716fa3c6
3 changed files with 3 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
|||
class ApiAdresse::Geocodeur
|
||||
def self.convert_adresse_to_point(address)
|
||||
ApiAdresse::PointRetriever.new(address).point
|
||||
ApiAdresse::PointAdapter.new(address).point
|
||||
rescue RestClient::Exception, JSON::ParserError => e
|
||||
Rails.logger.error(e.message)
|
||||
nil
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class ApiAdresse::PointRetriever
|
||||
class ApiAdresse::PointAdapter
|
||||
def initialize(address)
|
||||
@address = address
|
||||
end
|
|
@ -16,7 +16,7 @@ describe ApiAdresse::Geocodeur do
|
|||
end
|
||||
context 'when JSON::ParserError' do
|
||||
before do
|
||||
allow_any_instance_of(ApiAdresse::PointRetriever).to receive(:point).and_raise(JSON::ParserError)
|
||||
allow_any_instance_of(ApiAdresse::PointAdapter).to receive(:point).and_raise(JSON::ParserError)
|
||||
end
|
||||
it 'return nil' do
|
||||
expect(described_class.convert_adresse_to_point(address)).to be_nil
|
||||
|
|
Loading…
Reference in a new issue