From 83be88028174d31abd3bcc328c4fba0b6b78b304 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Tue, 22 Sep 2020 18:04:43 +0300 Subject: [PATCH] Verify no unaccessible contacts are exposed in registrant portal --- test/fixtures/contacts.yml | 12 ++++++++++++ test/system/registrant_area/domains/list_test.rb | 16 +++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/test/fixtures/contacts.yml b/test/fixtures/contacts.yml index 0173d56dd..4d45738bd 100644 --- a/test/fixtures/contacts.yml +++ b/test/fixtures/contacts.yml @@ -78,6 +78,18 @@ identical_to_william: auth_info: 5ab865 uuid: c0a191d5-3793-4f0b-8f85-491612d0293e +registrar_ltd: + name: Registrar Ltd + email: registrar@inbox.test + phone: '+555.555' + ident: 1234567890 + ident_type: org + registrar: goodnames + ident_country_code: US + code: registrarltd-001 + auth_info: e2c441 + uuid: 28b65455-6f1a-49fd-961c-0758886dbd76 + invalid: name: any code: invalid diff --git a/test/system/registrant_area/domains/list_test.rb b/test/system/registrant_area/domains/list_test.rb index 805b130de..3cbf477da 100644 --- a/test/system/registrant_area/domains/list_test.rb +++ b/test/system/registrant_area/domains/list_test.rb @@ -28,6 +28,20 @@ class RegistrantAreaDomainListTest < ApplicationSystemTestCase assert_no_text 'metro.test' end + def test_only_shows_direct_relation_and_or_company_domains + # case https://github.com/internetee/registry/issues/1690 + tech_contact = contacts(:registrar_ltd) + + # All domains share the same tech contact object + Domain.all.each do |domain| + DomainContact.create(domain: domain, contact: tech_contact, type: TechDomainContact) + end + + visit registrant_domains_url + assert_no_text 'Company register is unavailable.' + assert_no_text 'metro.test' + end + def test_notification_when_company_register_is_unavailable CompanyRegister::Client.stub(:new, CompanyRegisterClientStub.new) do visit registrant_domains_url @@ -54,4 +68,4 @@ class RegistrantAreaDomainListTest < ApplicationSystemTestCase assert_text 'shop.test' end -end \ No newline at end of file +end