From 622dba4f1c9b3528c5e9ef216135100226a3ebeb Mon Sep 17 00:00:00 2001 From: olegphenomenon Date: Wed, 15 Sep 2021 14:29:59 +0300 Subject: [PATCH] init --- .idea/.gitignore | 8 + .idea/misc.xml | 4 + .idea/modules.xml | 8 + .idea/registry.iml | 148 +++++++++++++++++++ .idea/vcs.xml | 6 + app/models/registrant_user.rb | 7 +- test/models/domain/registry_lockable_test.rb | 13 ++ 7 files changed, 191 insertions(+), 3 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/registry.iml create mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 000000000..73f69e095 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 000000000..fbdc941de --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 000000000..522f775f7 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/registry.iml b/.idea/registry.iml new file mode 100644 index 000000000..452ddb22e --- /dev/null +++ b/.idea/registry.iml @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 000000000..94a25f7f4 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/models/registrant_user.rb b/app/models/registrant_user.rb index f7e85c5af..82ace6e89 100644 --- a/app/models/registrant_user.rb +++ b/app/models/registrant_user.rb @@ -17,12 +17,13 @@ class RegistrantUser < User Country.new(alpha2_code) end - def companies(company_register = CompanyRegister::Client.new) + def companies(company_register = nil) return [] if ident.include?('-') - company_register.representation_rights(citizen_personal_code: ident, - citizen_country_code: country.alpha3) + [OpenStruct.new(registration_number: '43344412', company_name: 'TestFirma'), + OpenStruct.new(registration_number: '12345678', company_name: 'SuperFirma OU')] end + def contacts(representable: true) Contact.registrant_user_contacts(self, representable: representable) diff --git a/test/models/domain/registry_lockable_test.rb b/test/models/domain/registry_lockable_test.rb index c8ea69fd1..e4398762f 100644 --- a/test/models/domain/registry_lockable_test.rb +++ b/test/models/domain/registry_lockable_test.rb @@ -146,6 +146,19 @@ class DomainRegistryLockableTest < ActiveSupport::TestCase refute(@domain.remove_registry_lock) end + def test_set_lock_for_domain_with_force_delete_status + @domain.schedule_force_delete(type: :soft) + @domain.reload + + assert @domain.force_delete_scheduled? + + assert @domain.apply_registry_lock + + assert @domain.statuses.include? DomainStatus::SERVER_DELETE_PROHIBITED + assert @domain.statuses.include? DomainStatus::SERVER_TRANSFER_PROHIBITED + assert @domain.statuses.include? DomainStatus::SERVER_UPDATE_PROHIBITED + end + private def check_statuses_lockable_domain