From 069cd2eba81e75f82477a3fe6ab9a2b43744b093 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Sun, 1 Oct 2023 19:18:34 -0700 Subject: [PATCH] Improved geocoding tests --- test/geocode_test.rb | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/test/geocode_test.rb b/test/geocode_test.rb index 68707738..b2e8e0ae 100644 --- a/test/geocode_test.rb +++ b/test/geocode_test.rb @@ -5,7 +5,11 @@ def self.search(ip) require "ostruct" [OpenStruct.new( - country: "Test" + country: "Country", + state: "Region", + city: "City", + latitude: 1, + longitude: 2 )] end end @@ -17,7 +21,12 @@ def test_geocode_true get products_url end perform_enqueued_jobs - assert_equal "Test", Ahoy::Visit.last.country + visit = Ahoy::Visit.last + assert_equal "Country", visit.country + assert_equal "Region", visit.region + assert_equal "City", visit.city + assert_equal 1, visit.latitude + assert_equal 2, visit.longitude end end @@ -27,7 +36,12 @@ def test_geocode_true_cookies_none get products_url end perform_enqueued_jobs - assert_equal "Test", Ahoy::Visit.last.country + visit = Ahoy::Visit.last + assert_equal "Country", visit.country + assert_equal "Region", visit.region + assert_equal "City", visit.city + assert_equal 1, visit.latitude + assert_equal 2, visit.longitude end end