|
|
|
@ -57,9 +57,10 @@ describe Geocoding do
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
describe '#run!' do
|
|
|
|
|
it 'updates total_rows, processed_rows and state' do
|
|
|
|
|
it 'updates total_rows, processed_rows, cache_hits and state' do
|
|
|
|
|
geocoding = Geocoding.create(user: @user, table: @table, formatter: 'b')
|
|
|
|
|
geocoding.table_geocoder.stubs(:run).returns true
|
|
|
|
|
geocoding.table_geocoder.stubs(:cache).returns OpenStruct.new(hits: 5)
|
|
|
|
|
geocoding.table_geocoder.stubs(:process_results).returns true
|
|
|
|
|
CartoDB::Geocoder.any_instance.stubs(:status).returns 'completed'
|
|
|
|
|
CartoDB::Geocoder.any_instance.stubs(:update_status).returns true
|
|
|
|
@ -70,6 +71,7 @@ describe Geocoding do
|
|
|
|
|
geocoding.total_rows.should eq 20
|
|
|
|
|
geocoding.processed_rows.should eq 10
|
|
|
|
|
geocoding.state.should eq 'finished'
|
|
|
|
|
geocoding.cache_hits.should eq 5
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
it 'marks the geocoding as failed if the geocoding job fails' do
|
|
|
|
|