mirror of
https://github.com/internetee/registry.git
synced 2025-07-25 03:58:27 +02:00
Replaced address with local and international addr
This commit is contained in:
parent
fe54f327d9
commit
2655da4555
16 changed files with 208 additions and 57 deletions
|
@ -29,17 +29,30 @@ describe 'EPP Contact', epp: true do
|
|||
expect(response[:result_code]).to eq('1000')
|
||||
expect(response[:msg]).to eq('Command completed successfully')
|
||||
expect(response[:clTRID]).to eq('ABC-12345')
|
||||
expect(Contact.first.created_by_id).to be 1
|
||||
expect(Contact.first.updated_by_id).to be nil
|
||||
expect(Contact.first.created_by_id).to eq 1
|
||||
expect(Contact.first.updated_by_id).to eq nil
|
||||
|
||||
expect(Contact.count).to eq(1)
|
||||
expect(Contact.first.org_name).to eq('Example Inc.')
|
||||
|
||||
|
||||
expect(Contact.first.international_address.org_name).to eq('Example Inc.')
|
||||
expect(Contact.first.ident).to eq '37605030299'
|
||||
expect(Contact.first.ident_type).to eq 'op'
|
||||
|
||||
expect(Contact.first.address.street).to eq('123 Example Dr.')
|
||||
expect(Contact.first.address.street2).to eq('Suite 100')
|
||||
expect(Contact.first.address.street3).to eq nil
|
||||
expect(Contact.first.international_address.street).to eq('123 Example Dr.')
|
||||
expect(Contact.first.international_address.street2).to eq('Suite 100')
|
||||
expect(Contact.first.international_address.street3).to eq nil
|
||||
end
|
||||
|
||||
it 'successfully creates contact with 2 addresses' do
|
||||
response = epp_request('contacts/create_with_two_addresses.xml')
|
||||
|
||||
expect(response[:result_code]).to eq('1000')
|
||||
|
||||
expect(Contact.count).to eq(1)
|
||||
expect(Contact.first.address).to_not eq Contact.first.local_address
|
||||
expect(Address.count).to eq(2)
|
||||
expect(LocalAddress.count).to eq(1)
|
||||
end
|
||||
|
||||
it 'returns result data upon success' do
|
||||
|
@ -62,6 +75,7 @@ describe 'EPP Contact', epp: true do
|
|||
|
||||
response = epp_request(contact_create_xml, :xml)
|
||||
|
||||
|
||||
expect(response[:result_code]).to eq('2302')
|
||||
expect(response[:msg]).to eq('Contact id already exists')
|
||||
|
||||
|
@ -207,8 +221,9 @@ describe 'EPP Contact', epp: true do
|
|||
end
|
||||
|
||||
it 'returns info about contact' do
|
||||
Fabricate(:contact, name: "Johnny Awesome", created_by_id: '1', code: 'info-4444', auth_info: '2fooBAR')
|
||||
Fabricate(:address)
|
||||
Fabricate(:contact, created_by_id: '1', code: 'info-4444', auth_info: '2fooBAR',
|
||||
international_address: Fabricate(:international_address, name: 'Johnny Awesome'))
|
||||
#Fabricate(:international_address, name: 'Johnny Awesome')
|
||||
|
||||
response = epp_request('contacts/info.xml')
|
||||
contact = response[:parsed].css('resData chkData')
|
||||
|
@ -220,7 +235,7 @@ describe 'EPP Contact', epp: true do
|
|||
end
|
||||
|
||||
it 'doesn\'t display unassociated object' do
|
||||
Fabricate(:contact, name:"Johnny Awesome", code: 'info-4444')
|
||||
Fabricate(:contact, code: 'info-4444')
|
||||
|
||||
response = epp_request('contacts/info.xml')
|
||||
expect(response[:result_code]).to eq('2201')
|
||||
|
|
45
spec/epp/requests/contacts/create_with_two_addresses.xml
Normal file
45
spec/epp/requests/contacts/create_with_two_addresses.xml
Normal file
|
@ -0,0 +1,45 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
|
||||
<command>
|
||||
<create>
|
||||
<contact:create
|
||||
xmlns:contact="urn:ietf:params:xml:ns:contact-1.0">
|
||||
<contact:id>loc_int</contact:id>
|
||||
<contact:postalInfo type="int">
|
||||
<contact:name>John Doe Int</contact:name>
|
||||
<contact:org>Example Int Inc.</contact:org>
|
||||
<contact:addr>
|
||||
<contact:street>International street 1</contact:street>
|
||||
<contact:city>Dulles</contact:city>
|
||||
<contact:sp>VA</contact:sp>
|
||||
<contact:pc>20166-6503</contact:pc>
|
||||
<contact:cc>EE</contact:cc>
|
||||
</contact:addr>
|
||||
</contact:postalInfo>
|
||||
<contact:postalInfo type="loc">
|
||||
<contact:name>John Doe Loc</contact:name>
|
||||
<contact:org>Example Loc Inc.</contact:org>
|
||||
<contact:addr>
|
||||
<contact:street>Local street 1</contact:street>
|
||||
<contact:city>Vancouver</contact:city>
|
||||
<contact:sp>BC</contact:sp>
|
||||
<contact:pc>27123</contact:pc>
|
||||
<contact:cc>CA</contact:cc>
|
||||
</contact:addr>
|
||||
</contact:postalInfo>
|
||||
<contact:voice x="1234">+123.7035555555</contact:voice>
|
||||
<contact:fax>+1.7035555556</contact:fax>
|
||||
<contact:email>jdoe@example.com</contact:email>
|
||||
<contact:ident type="op">37605030299</contact:ident>
|
||||
<contact:authInfo>
|
||||
<contact:pw>2fooBAR</contact:pw>
|
||||
</contact:authInfo>
|
||||
<contact:disclose flag="0">
|
||||
<contact:voice/>
|
||||
<contact:email/>
|
||||
</contact:disclose>
|
||||
</contact:create>
|
||||
</create>
|
||||
<clTRID>ABC-12345</clTRID>
|
||||
</command>
|
||||
</epp>
|
Loading…
Add table
Add a link
Reference in a new issue