Maintenance: Fixed result data in the geo ip test.

This commit is contained in:
Dominik Klein 2022-01-17 08:43:38 +01:00
parent 46b5761b9a
commit 4a954178b9

View file

@ -28,11 +28,11 @@ class GeoIpTest < ActiveSupport::TestCase
result = Service::GeoIp.location('195.65.29.254') result = Service::GeoIp.location('195.65.29.254')
assert(result) assert(result)
assert_equal('Switzerland', result['country_name']) assert_equal('Switzerland', result['country_name'])
assert_equal('Regensdorf', result['city_name']) assert_equal('Niederhasli', result['city_name'])
assert_equal('CH', result['country_code']) assert_equal('CH', result['country_code'])
assert_equal('EU', result['continent_code']) assert_equal('EU', result['continent_code'])
assert_equal(47.4341, result['latitude']) assert_equal(47.4823, result['latitude'])
assert_equal(8.4687, result['longitude']) assert_equal(8.4823, result['longitude'])
result = Service::GeoIp.location('134.109.140.74') result = Service::GeoIp.location('134.109.140.74')
assert(result) assert(result)
@ -40,8 +40,8 @@ class GeoIpTest < ActiveSupport::TestCase
assert_equal('Chemnitz', result['city_name']) assert_equal('Chemnitz', result['city_name'])
assert_equal('DE', result['country_code']) assert_equal('DE', result['country_code'])
assert_equal('EU', result['continent_code']) assert_equal('EU', result['continent_code'])
assert_equal(50.8197, result['latitude']) assert_equal(50.8191, result['latitude'])
assert_equal(12.9403, result['longitude']) assert_equal(12.9419, result['longitude'])
result = Service::GeoIp.location('46.253.55.170') result = Service::GeoIp.location('46.253.55.170')
assert(result) assert(result)
@ -49,16 +49,16 @@ class GeoIpTest < ActiveSupport::TestCase
assert_equal('Halle', result['city_name']) assert_equal('Halle', result['city_name'])
assert_equal('DE', result['country_code']) assert_equal('DE', result['country_code'])
assert_equal('EU', result['continent_code']) assert_equal('EU', result['continent_code'])
assert_equal(51.5036, result['latitude']) assert_equal(51.4825, result['latitude'])
assert_equal(11.9594, result['longitude']) assert_equal(11.9772, result['longitude'])
result = Service::GeoIp.location('169.229.216.200') result = Service::GeoIp.location('169.229.216.200')
assert(result) assert(result)
assert_equal('United States', result['country_name']) assert_equal('United States', result['country_name'])
assert_equal('Alameda', result['city_name']) assert_equal('Oakland', result['city_name'])
assert_equal('US', result['country_code']) assert_equal('US', result['country_code'])
assert_equal('NA', result['continent_code']) assert_equal('NA', result['continent_code'])
assert_equal(37.7688, result['latitude']) assert_equal(37.8376, result['latitude'])
assert_equal(-122.262, result['longitude']) assert_equal(-122.2398, result['longitude'])
end end
end end