mirror of
https://github.com/internetee/registry.git
synced 2025-06-08 05:34:46 +02:00
Add company controlled contacts to registrant API
Fix tests.
This commit is contained in:
parent
735a0e1642
commit
c4de5655e1
8 changed files with 45 additions and 35 deletions
|
@ -150,13 +150,12 @@ class ContactTest < ActiveSupport::TestCase
|
|||
end
|
||||
|
||||
def test_returns_registrant_user_indirect_contacts
|
||||
@contact.update!(ident_type: Contact::ORG)
|
||||
assert_equal '1234', @contact.ident
|
||||
@contact.update!(ident_type: Contact::ORG, ident: '1234321')
|
||||
assert_equal 'US', @contact.ident_country_code
|
||||
registrant_user = RegistrantUser.new(registrant_ident: 'US-1234')
|
||||
registrant_user = RegistrantUser.new(registrant_ident: 'US-1234321')
|
||||
|
||||
registrant_user.stub(:companies, [OpenStruct.new(registration_number: '1234')]) do
|
||||
assert_equal [@contact], Contact.registrant_user_contacts(registrant_user)
|
||||
registrant_user.stub(:companies, [OpenStruct.new(registration_number: '1234321')]) do
|
||||
assert_equal registrant_user.contacts, Contact.registrant_user_contacts(registrant_user)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -273,7 +273,7 @@ class DomainTest < ActiveSupport::TestCase
|
|||
def test_returns_registrant_user_domains_by_registrant
|
||||
registrant = contacts(:john).becomes(Registrant)
|
||||
assert_equal registrant, @domain.registrant
|
||||
registrant_user = RegistrantUser.new
|
||||
registrant_user = RegistrantUser.new(registrant_ident: 'US-12345')
|
||||
|
||||
registrant_user.stub(:contacts, [registrant]) do
|
||||
assert_includes Domain.registrant_user_domains(registrant_user), @domain
|
||||
|
@ -284,7 +284,7 @@ class DomainTest < ActiveSupport::TestCase
|
|||
contact = contacts(:jane)
|
||||
assert_not_equal contact.becomes(Registrant), @domain.registrant
|
||||
assert_includes @domain.contacts, contact
|
||||
registrant_user = RegistrantUser.new
|
||||
registrant_user = RegistrantUser.new(registrant_ident: 'US-12345')
|
||||
|
||||
registrant_user.stub(:contacts, [contact]) do
|
||||
assert_includes Domain.registrant_user_domains(registrant_user), @domain
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue