Sha256: 294263bbf4bd95f491b0f10f57562ba70b5d9bf043644f94474b7a001d5b02d4

Contents?: true

Size: 587 Bytes

Versions: 1

Compression:

Stored size: 587 Bytes

Contents

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

class IpApiGeocoderTest < BaseGeocoderTest #:nodoc: all
  def setup
    super
    @ip = '74.125.237.209'
  end

  def assert_url(expected_url)
    assert_equal expected_url, TestHelper.last_url
  end

  def test_ip_api_geocode
    url = "http://ip-api.com/json/#{@ip}"
    res = geocode(@ip, :ip_api_geocode)
    assert_url url
    assert_equal res.city, 'Mountain View'
    assert_equal res.state, 'CA'
    assert_equal res.state_name, 'California'
    assert_equal res.zip, '94043'
    assert_equal res.country_code, 'US'
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
geokit-1.14.0 test/test_ip_api_geocoder.rb