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 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? -%> <%- if json['admin_contacts'].present? -%>
Administrative contact: Administrative contact:
<%- for contact in json['admin_contacts'] -%> <%- 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 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 -%>
<%- end -%> <%- end -%>
<% if json['tech_contacts'].present? %> <% if json['tech_contacts'].present? %>
Technical contact: Technical contact:
<%- for contact in json['tech_contacts'] -%> <%- 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 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 -%>
<%- end -%> <%- end -%>

View file

@ -32,15 +32,22 @@ class WhoisRecordTest < ActiveSupport::TestCase
end end
def test_generated_body_has_justified_disclaimer def test_generated_body_has_justified_disclaimer
expected_disclaimer_first_line = begin expected_disclaimer = begin
"Search results may not be used for commercial, advertising, recompilation," 'Search results may not be used for commercial, advertising, recompilation,\n' \
'repackaging, redistribution, reuse, obscuring or other similar activities.'
end end
expected_disclaimer_second_line = begin expected_technical_contact = begin
"repackaging, redistribution, reuse, obscuring or other similar activities" '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 end
@record.populate
assert_match(expected_disclaimer_first_line, @record.body) regexp_contact = Regexp.new(expected_technical_contact, Regexp::MULTILINE)
assert_match(expected_disclaimer_second_line, @record.body) regexp_disclaimer = Regexp.new(expected_disclaimer, Regexp::MULTILINE)
@record.populate
assert_match(regexp_disclaimer, @record.body)
assert_match(regexp_contact, @record.body)
end end
end end