mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 11:16:00 +02:00
parent
8c4e6f1656
commit
83f8a9fb6a
44 changed files with 530 additions and 610 deletions
|
@ -1,12 +1,17 @@
|
|||
require 'test_helper'
|
||||
|
||||
CompanyRegisterClientStub = Struct.new(:any_method) do
|
||||
def representation_rights(citizen_personal_code:, citizen_country_code:)
|
||||
raise CompanyRegister::NotAvailableError
|
||||
end
|
||||
end
|
||||
|
||||
class RegistrantAreaDomainListTest < ApplicationSystemTestCase
|
||||
setup do
|
||||
sign_in users(:registrant)
|
||||
@domain = domains(:shop)
|
||||
@user = users(:registrant)
|
||||
sign_in @user
|
||||
|
||||
Setting.days_to_keep_business_registry_cache = 1
|
||||
travel_to Time.zone.parse('2010-07-05')
|
||||
@domain = domains(:shop)
|
||||
end
|
||||
|
||||
def test_show_domain_list
|
||||
|
@ -22,4 +27,31 @@ class RegistrantAreaDomainListTest < ApplicationSystemTestCase
|
|||
visit registrant_domains_url
|
||||
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
|
||||
end
|
||||
|
||||
assert_text 'Company register is unavailable. Domains and contacts associated via' \
|
||||
' organizations are not shown.'
|
||||
end
|
||||
|
||||
def test_show_direct_domains_when_company_register_is_unavailable
|
||||
assert_equal 'US-1234', @user.registrant_ident
|
||||
|
||||
contact = contacts(:john)
|
||||
assert_equal '1234', contact.ident
|
||||
assert_equal Contact::PRIV, contact.ident_type
|
||||
assert_equal 'US', contact.ident_country_code
|
||||
|
||||
assert_equal contact.becomes(Registrant), @domain.registrant
|
||||
assert_equal 'shop.test', @domain.name
|
||||
|
||||
CompanyRegister::Client.stub(:new, CompanyRegisterClientStub.new) do
|
||||
visit registrant_domains_url
|
||||
end
|
||||
|
||||
assert_text 'shop.test'
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue