mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 03:06:14 +02:00
Merge remote-tracking branch 'origin/master' into 1629-change-settings-storage-mechanism
This commit is contained in:
commit
2330e8eab1
24 changed files with 443 additions and 31 deletions
|
@ -152,6 +152,8 @@ class ContactTest < ActiveSupport::TestCase
|
|||
end
|
||||
|
||||
def test_address
|
||||
Setting.address_processing = true
|
||||
|
||||
address = Contact::Address.new('new street', '83746', 'new city', 'new state', 'EE')
|
||||
@contact.address = address
|
||||
@contact.save!
|
||||
|
@ -238,6 +240,7 @@ class ContactTest < ActiveSupport::TestCase
|
|||
end
|
||||
|
||||
def test_normalizes_country_code
|
||||
Setting.address_processing = true
|
||||
contact = Contact.new(country_code: 'us')
|
||||
contact.validate
|
||||
assert_equal 'US', contact.country_code
|
||||
|
|
|
@ -124,6 +124,60 @@ class DNS::ZoneTest < ActiveSupport::TestCase
|
|||
assert zone.invalid?
|
||||
end
|
||||
|
||||
def test_determines_if_subzone
|
||||
zone = valid_zone
|
||||
zone.update(origin: 'pri.ee')
|
||||
assert zone.subzone?
|
||||
end
|
||||
|
||||
def test_updates_whois_after_update
|
||||
subzone = dns_zones(:one).dup
|
||||
|
||||
subzone.origin = 'sub.zone'
|
||||
subzone.save
|
||||
|
||||
whois_record = Whois::Record.find_by(name: subzone.origin)
|
||||
assert whois_record.present?
|
||||
end
|
||||
|
||||
def test_has_setting_info_as_contacts_for_subzones
|
||||
subzone = dns_zones(:one).dup
|
||||
|
||||
subzone.origin = 'sub.zone'
|
||||
subzone.save
|
||||
|
||||
whois_record = Whois::Record.find_by(name: subzone.origin)
|
||||
assert whois_record.present?
|
||||
|
||||
assert_equal Setting.registry_whois_disclaimer, whois_record.json['disclaimer']
|
||||
assert_equal Setting.registry_email, whois_record.json['email']
|
||||
assert_equal Setting.registry_juridical_name, whois_record.json['registrar']
|
||||
assert_equal Setting.registry_url, whois_record.json['registrar_website']
|
||||
assert_equal Setting.registry_phone, whois_record.json['registrar_phone']
|
||||
|
||||
assert_equal Setting.registry_juridical_name, whois_record.json['registrant']
|
||||
assert_equal Setting.registry_reg_no, whois_record.json['registrant_reg_no']
|
||||
assert_equal Setting.registry_country_code, whois_record.json['registrant_ident_country_code']
|
||||
|
||||
contact = { name: Setting.registry_invoice_contact, email: Setting.registry_email,
|
||||
disclosed_attributes: %w[name email] }.with_indifferent_access
|
||||
|
||||
assert_equal contact, whois_record.json['admin_contacts'][0]
|
||||
assert_equal contact, whois_record.json['tech_contacts'][0]
|
||||
end
|
||||
|
||||
def test_deletes_whois_record_after_destroy
|
||||
subzone = dns_zones(:one).dup
|
||||
|
||||
subzone.origin = 'sub.zone'
|
||||
subzone.save
|
||||
|
||||
assert Whois::Record.find_by(name: subzone.origin).present?
|
||||
|
||||
subzone.destroy
|
||||
assert_nil Whois::Record.find_by(name: subzone.origin)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def valid_zone
|
||||
|
|
|
@ -28,6 +28,7 @@ class EppResponseResultCodeTest < ActiveSupport::TestCase
|
|||
codes = {
|
||||
completed_successfully: 1000,
|
||||
completed_successfully_action_pending: 1001,
|
||||
completed_without_address: 1100,
|
||||
completed_successfully_no_messages: 1300,
|
||||
completed_successfully_ack_to_dequeue: 1301,
|
||||
completed_successfully_ending_session: 1500,
|
||||
|
@ -58,6 +59,7 @@ class EppResponseResultCodeTest < ActiveSupport::TestCase
|
|||
descriptions = {
|
||||
1000 => 'Command completed successfully',
|
||||
1001 => 'Command completed successfully; action pending',
|
||||
1100 => 'Command completed successfully; Postal address data discarded',
|
||||
1300 => 'Command completed successfully; no messages',
|
||||
1301 => 'Command completed successfully; ack to dequeue',
|
||||
1500 => 'Command completed successfully; ending session',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue