From 5a8e473ef7ba3f4697fd9bee1b953381bd61cb7d Mon Sep 17 00:00:00 2001 From: Gregory Oschwald Date: Tue, 20 Jan 2026 09:18:29 -0800 Subject: [PATCH] Add anonymizer property tests for IpAddress model Co-Authored-By: Claude Opus 4.5 --- spec/fixtures/files/factors-response1.json | 11 +++++++++++ spec/fixtures/files/insights-response1.json | 11 +++++++++++ spec/model/insights_spec.rb | 12 ++++++++++++ 3 files changed, 34 insertions(+) diff --git a/spec/fixtures/files/factors-response1.json b/spec/fixtures/files/factors-response1.json index 22b1567..3242ffa 100644 --- a/spec/fixtures/files/factors-response1.json +++ b/spec/fixtures/files/factors-response1.json @@ -129,6 +129,17 @@ "static_ip_score": 13.5, "user_count": 5, "user_type": "government" + }, + "anonymizer": { + "confidence": 99, + "is_anonymous": true, + "is_anonymous_vpn": true, + "is_hosting_provider": true, + "is_public_proxy": true, + "is_residential_proxy": true, + "is_tor_exit_node": true, + "network_last_seen": "2025-01-15", + "provider_name": "TestVPN" } }, "billing_address": { diff --git a/spec/fixtures/files/insights-response1.json b/spec/fixtures/files/insights-response1.json index 7e72bb6..9699671 100644 --- a/spec/fixtures/files/insights-response1.json +++ b/spec/fixtures/files/insights-response1.json @@ -141,6 +141,17 @@ "static_ip_score": 13.5, "user_count": 5, "user_type": "government" + }, + "anonymizer": { + "confidence": 99, + "is_anonymous": true, + "is_anonymous_vpn": true, + "is_hosting_provider": true, + "is_public_proxy": true, + "is_residential_proxy": true, + "is_tor_exit_node": true, + "network_last_seen": "2025-01-15", + "provider_name": "TestVPN" } }, "billing_address": { diff --git a/spec/model/insights_spec.rb b/spec/model/insights_spec.rb index 227f148..369ff93 100644 --- a/spec/model/insights_spec.rb +++ b/spec/model/insights_spec.rb @@ -88,6 +88,18 @@ expect(m.ip_address.traits.user_count).to eq 5 expect(m.ip_address.traits.user_type).to eq 'government' + expect(m.ip_address.anonymizer).to have_attributes( + confidence: 99, + anonymous?: true, + anonymous_vpn?: true, + hosting_provider?: true, + public_proxy?: true, + residential_proxy?: true, + tor_exit_node?: true, + network_last_seen: Date.new(2_025, 1, 15), + provider_name: 'TestVPN' + ) + expect(m.billing_address.is_postal_in_city).to be false expect(m.billing_address.latitude).to eq 41.310571 expect(m.billing_address.longitude).to eq(-72.922891)