Skip to content

Commit 5a8e473

Browse files
oschwaldclaude
andcommitted
Add anonymizer property tests for IpAddress model
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 0d13baa commit 5a8e473

3 files changed

Lines changed: 34 additions & 0 deletions

File tree

spec/fixtures/files/factors-response1.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,17 @@
129129
"static_ip_score": 13.5,
130130
"user_count": 5,
131131
"user_type": "government"
132+
},
133+
"anonymizer": {
134+
"confidence": 99,
135+
"is_anonymous": true,
136+
"is_anonymous_vpn": true,
137+
"is_hosting_provider": true,
138+
"is_public_proxy": true,
139+
"is_residential_proxy": true,
140+
"is_tor_exit_node": true,
141+
"network_last_seen": "2025-01-15",
142+
"provider_name": "TestVPN"
132143
}
133144
},
134145
"billing_address": {

spec/fixtures/files/insights-response1.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,17 @@
141141
"static_ip_score": 13.5,
142142
"user_count": 5,
143143
"user_type": "government"
144+
},
145+
"anonymizer": {
146+
"confidence": 99,
147+
"is_anonymous": true,
148+
"is_anonymous_vpn": true,
149+
"is_hosting_provider": true,
150+
"is_public_proxy": true,
151+
"is_residential_proxy": true,
152+
"is_tor_exit_node": true,
153+
"network_last_seen": "2025-01-15",
154+
"provider_name": "TestVPN"
144155
}
145156
},
146157
"billing_address": {

spec/model/insights_spec.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,18 @@
8888
expect(m.ip_address.traits.user_count).to eq 5
8989
expect(m.ip_address.traits.user_type).to eq 'government'
9090

91+
expect(m.ip_address.anonymizer).to have_attributes(
92+
confidence: 99,
93+
anonymous?: true,
94+
anonymous_vpn?: true,
95+
hosting_provider?: true,
96+
public_proxy?: true,
97+
residential_proxy?: true,
98+
tor_exit_node?: true,
99+
network_last_seen: Date.new(2_025, 1, 15),
100+
provider_name: 'TestVPN'
101+
)
102+
91103
expect(m.billing_address.is_postal_in_city).to be false
92104
expect(m.billing_address.latitude).to eq 41.310571
93105
expect(m.billing_address.longitude).to eq(-72.922891)

0 commit comments

Comments
 (0)