File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed
test/integration/whois_records Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -9,8 +9,7 @@ def email
9
9
end
10
10
11
11
def phone
12
- # publishable_attribute('phone')
13
- disclose_data_priv_registrant ( 'phone' )
12
+ registrant_is_org? ? disclose_registrant_org_phone : disclose_data_priv_registrant ( 'phone' )
14
13
end
15
14
16
15
def last_update
@@ -27,6 +26,18 @@ def disclose_attr(attr)
27
26
end
28
27
end
29
28
29
+ def disclose_registrant_org_phone
30
+ phone_disclosed_and_captcha_solved = contact . attribute_disclosed? ( 'phone' ) && captcha_solved?
31
+
32
+ if phone_disclosed_and_captcha_solved || whitelisted_user? || registrant_publishable?
33
+ contact . send ( 'phone' )
34
+ elsif !contact . attribute_disclosed? ( 'phone' )
35
+ undisclosable_mask
36
+ else
37
+ disclosable_mask
38
+ end
39
+ end
40
+
30
41
def disclose_data_priv_registrant ( attr )
31
42
return contact . send ( attr . to_sym ) if whitelisted_user?
32
43
return undisclosable_mask unless contact . attribute_disclosed? ( attr )
Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ def test_hide_sensitive_data_of_legal_entity_when_captcha_is_unsolved
125
125
response_json = JSON . parse ( response . body , symbolize_names : true )
126
126
127
127
assert_equal 'Not Disclosed - Visit www.internet.ee for web-based WHOIS' , response_json [ :email ]
128
- assert_equal 'Not Disclosed' , response_json [ :phone ]
128
+ assert_equal 'Not Disclosed - Visit www.internet.ee for web-based WHOIS ' , response_json [ :phone ]
129
129
130
130
expected_admin_contacts = [
131
131
{ name : 'Not Disclosed - Visit www.internet.ee for web-based WHOIS' ,
@@ -233,7 +233,7 @@ def test_hide_sensitive_data_of_legal_entity_when_ip_is_not_in_whitelist
233
233
response_json = JSON . parse ( response . body , symbolize_names : true )
234
234
235
235
assert_equal 'Not Disclosed - Visit www.internet.ee for web-based WHOIS' , response_json [ :email ]
236
- assert_equal 'Not Disclosed' , response_json [ :phone ]
236
+ assert_equal 'Not Disclosed - Visit www.internet.ee for web-based WHOIS ' , response_json [ :phone ]
237
237
assert_equal 'Not Disclosed - Visit www.internet.ee for web-based WHOIS' ,
238
238
response_json [ :registrant_changed ]
239
239
You can’t perform that action at this time.
0 commit comments