Sha256: 8c9bec242f41ae70c23066e40e6fcba55add65f5a2a45d36d9a7239a9d2c17c7

Contents?: true

Size: 687 Bytes

Versions: 2

Compression:

Stored size: 687 Bytes

Contents

require File.join(File.dirname(__FILE__), 'helper')

class FCCGeocoderTest < BaseGeocoderTest #:nodoc: all
  def setup
    super
    @la = Geokit::LatLng.new(34.05, -118.25)
    @base_url = 'https://data.fcc.gov/api/block/find'
  end

  def assert_url(expected_url)
    assert_equal expected_url, TestHelper.last_url.gsub(/&oauth_[a-z_]+=[a-zA-Z0-9\-. %]+/, '').gsub('%20', '+')
  end

  def test_fcc_reverse_geocode
    url = "#{@base_url}?format=json&latitude=34.05&longitude=-118.25"
    res = reverse_geocode(@la, :fcc_reverse_geocode)
    assert_url url
    assert_equal res.country_code, 'US'
    assert_equal res.state, 'CA'
    assert_equal res.district, 'Los Angeles'
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
geokit-1.12.0 test/test_fcc_geocoder.rb
geokit-1.11.0 test/test_fcc_geocoder.rb