Merge pull request #1644 from internetee/1642-refactor-registrant-api-contacts

Add company contacts to registrant API
This commit is contained in:
Timo Võhmar 2020-08-26 14:59:32 +03:00 committed by GitHub
commit dfe29fa986
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 48 additions and 18 deletions

View file

@ -180,13 +180,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