Add company controlled contacts to registrant API

Fix tests.
This commit is contained in:
Alex Sherman 2020-07-15 15:11:47 +05:00
parent 735a0e1642
commit c4de5655e1
8 changed files with 45 additions and 35 deletions

View file

@ -75,8 +75,11 @@ class RegistrantApiV1ContactDetailsTest < ActionDispatch::IntegrationTest
end
def test_unmanaged_contact_cannot_be_accessed
assert_equal 'US-1234', @user.registrant_ident
@contact.update!(ident: '12345')
@user.update!(registrant_ident: 'US-12345')
@contact.update!(ident: '12345879')
companies = Contact.where(ident_type: 'org')
companies.update_all(ident: '78964521')
companies.reload
get api_v1_registrant_contact_path(@contact.uuid), as: :json,
headers: { 'HTTP_AUTHORIZATION' => auth_token }
@ -93,4 +96,4 @@ class RegistrantApiV1ContactDetailsTest < ActionDispatch::IntegrationTest
hash = token_creator.token_in_hash
"Bearer #{hash[:access_token]}"
end
end
end