Testing Geocoder.ca Lookup Integration in alexreisner/geocoder
This test suite validates the Geocoder.ca lookup functionality within the Geocoder gem, focusing on proper address resolution and result formatting for Canadian locations. The tests ensure accurate geocoding responses and proper parsing of location components.
Test Coverage Overview
Implementation Analysis
Technical Details
Best Practices Demonstrated
alexreisner/geocoder
test/unit/lookups/geocoder_ca_test.rb
# encoding: utf-8
require 'test_helper'
class GeocoderCaTest < GeocoderTestCase
def setup
super
Geocoder.configure(lookup: :geocoder_ca)
set_api_key!(:geocoder_ca)
end
def test_result_components
result = Geocoder.search([45.423733, -75.676333]).first
assert_equal "CA", result.country_code
assert_equal "289 Somerset ST E, Ottawa, ON K1N6W1, Canada", result.address
end
end