Sha256: cbe0f431553d24fbf8e3475c42bb114b56cc89f36fe794954f95e28107ece28b

Contents?: true

Size: 600 Bytes

Versions: 5

Compression:

Stored size: 600 Bytes

Contents

require File.join(File.dirname(__FILE__), 'helper')
class GeobytesGeocoderTest < BaseGeocoderTest #:nodoc: all
  def setup
    super
    @ip = '12.12.12.12'
  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_geobytes_geocoder
    url = "http://getcitydetails.geobytes.com/GetCityDetails?fqcn=#{@ip}"
    res = geocode(@ip, :geobytes_geocode)
    assert_url url
    assert_equal res.city, 'New York'
    assert_equal res.state, 'NY'
    assert_equal res.country_code, 'US'
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
geokit-1.14.0 test/test_geobytes_geocoder.rb
geokit-1.13.1 test/test_geobytes_geocoder.rb
geokit-1.13.0 test/test_geobytes_geocoder.rb
geokit-1.12.0 test/test_geobytes_geocoder.rb
geokit-1.11.0 test/test_geobytes_geocoder.rb