Remove technical and administrative contacts info

It's a partial solution for https://github.com/internetee/whois/issues/26
This commit is contained in:
Maciej Szlosarczyk 2018-04-26 11:44:05 +03:00
parent fcab0ccedb
commit 396852df53
No known key found for this signature in database
GPG key ID: 41D62D42D3B0D765
2 changed files with 19 additions and 12 deletions

View file

@ -1,4 +1,4 @@
<%= json['disclaimer'].scan(/\S.{0,72}\S(?=\s|$)|\S+/).join('\n') %>
<%= json['disclaimer'].scan(/\S.{0,72}\S(?=\s|$)|\S+/).join("\n") %>
Estonia .ee Top Level Domain WHOIS server
@ -25,18 +25,18 @@ changed: <%= json['registrant_changed'].to_s.tr('T',' ').sub('+', ' +') %>
<%- if json['admin_contacts'].present? -%>
Administrative contact:
<%- for contact in json['admin_contacts'] -%>
name: <%= contact['name'] %>
name: Not Disclosed - Visit www.internet.ee for webbased WHOIS
email: Not Disclosed - Visit www.internet.ee for webbased WHOIS
changed: <%= contact['changed'].to_s.tr('T',' ').sub('+', ' +') %>
changed: Not Disclosed - Visit www.internet.ee for webbased WHOIS
<%- end -%>
<%- end -%>
<% if json['tech_contacts'].present? %>
Technical contact:
<%- for contact in json['tech_contacts'] -%>
name: <%= contact['name'] %>
name: Not Disclosed - Visit www.internet.ee for webbased WHOIS
email: Not Disclosed - Visit www.internet.ee for webbased WHOIS
changed: <%= contact['changed'].to_s.tr('T',' ').sub('+', ' +') %>
changed: Not Disclosed - Visit www.internet.ee for webbased WHOIS
<%- end -%>
<%- end -%>

View file

@ -32,15 +32,22 @@ class WhoisRecordTest < ActiveSupport::TestCase
end
def test_generated_body_has_justified_disclaimer
expected_disclaimer_first_line = begin
"Search results may not be used for commercial, advertising, recompilation,"
expected_disclaimer = begin
'Search results may not be used for commercial, advertising, recompilation,\n' \
'repackaging, redistribution, reuse, obscuring or other similar activities.'
end
expected_disclaimer_second_line = begin
"repackaging, redistribution, reuse, obscuring or other similar activities"
expected_technical_contact = begin
'Technical contact:\n' \
'name: Not Disclosed - Visit www.internet.ee for webbased WHOIS\n' \
'email: Not Disclosed - Visit www.internet.ee for webbased WHOIS\n' \
'changed: Not Disclosed - Visit www.internet.ee for webbased WHOIS'
end
@record.populate
assert_match(expected_disclaimer_first_line, @record.body)
assert_match(expected_disclaimer_second_line, @record.body)
regexp_contact = Regexp.new(expected_technical_contact, Regexp::MULTILINE)
regexp_disclaimer = Regexp.new(expected_disclaimer, Regexp::MULTILINE)
@record.populate
assert_match(regexp_disclaimer, @record.body)
assert_match(regexp_contact, @record.body)
end
end