ApiAdresse::PointRetriever → ApiAdresse::PointAdapter

This commit is contained in:
gregoirenovel 2018-10-15 18:08:13 +02:00
parent 81d2b27160
commit af716fa3c6
3 changed files with 3 additions and 3 deletions

View file

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

View file

@ -1,4 +1,4 @@
class ApiAdresse::PointRetriever
class ApiAdresse::PointAdapter
def initialize(address)
@address = address
end

View file

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