mirror of
https://github.com/internetee/registry.git
synced 2025-07-24 19:48:28 +02:00
Address depricated, new contact requires, domain_contacts refactor
This commit is contained in:
parent
0e252b0b6b
commit
5fd73b037a
38 changed files with 402 additions and 501 deletions
|
@ -3,7 +3,6 @@ require 'rails_helper'
|
|||
describe 'EPP Contact', epp: true do
|
||||
before :all do
|
||||
create_settings
|
||||
create_disclosure_settings
|
||||
@registrar1 = Fabricate(:registrar1)
|
||||
@registrar2 = Fabricate(:registrar2)
|
||||
@epp_xml = EppXml::Contact.new(cl_trid: 'ABC-12345')
|
||||
|
@ -38,6 +37,7 @@ describe 'EPP Contact', epp: true do
|
|||
addr: {
|
||||
street: { value: '123 Example' },
|
||||
city: { value: 'Tallinn' },
|
||||
pc: { value: '123456' },
|
||||
cc: { value: 'EE' }
|
||||
}
|
||||
},
|
||||
|
@ -52,15 +52,19 @@ describe 'EPP Contact', epp: true do
|
|||
response = epp_plain_request(@epp_xml.create, :xml)
|
||||
response[:results][0][:msg].should ==
|
||||
'Required parameter missing: create > create > postalInfo > name [name]'
|
||||
response[:results][1][:msg].should ==
|
||||
response[:results][1][:msg].should ==
|
||||
'Required parameter missing: create > create > postalInfo > addr > street [street]'
|
||||
response[:results][2][:msg].should ==
|
||||
'Required parameter missing: create > create > postalInfo > addr > city [city]'
|
||||
response[:results][2][:msg].should ==
|
||||
response[:results][3][:msg].should ==
|
||||
'Required parameter missing: create > create > postalInfo > addr > pc [pc]'
|
||||
response[:results][4][:msg].should ==
|
||||
'Required parameter missing: create > create > postalInfo > addr > cc [cc]'
|
||||
response[:results][3][:msg].should ==
|
||||
response[:results][5][:msg].should ==
|
||||
'Required parameter missing: create > create > voice [voice]'
|
||||
response[:results][4][:msg].should ==
|
||||
response[:results][6][:msg].should ==
|
||||
'Required parameter missing: create > create > email [email]'
|
||||
response[:results][5][:msg].should ==
|
||||
response[:results][7][:msg].should ==
|
||||
'Required parameter missing: extension > extdata > ident [ident]'
|
||||
|
||||
response[:results][0][:result_code].should == '2003'
|
||||
|
@ -69,8 +73,10 @@ describe 'EPP Contact', epp: true do
|
|||
response[:results][3][:result_code].should == '2003'
|
||||
response[:results][4][:result_code].should == '2003'
|
||||
response[:results][5][:result_code].should == '2003'
|
||||
response[:results][6][:result_code].should == '2003'
|
||||
response[:results][7][:result_code].should == '2003'
|
||||
|
||||
response[:results].count.should == 6
|
||||
response[:results].count.should == 8
|
||||
end
|
||||
|
||||
it 'successfully creates a contact' do
|
||||
|
@ -84,7 +90,7 @@ describe 'EPP Contact', epp: true do
|
|||
@contact.registrar.should == @registrar1
|
||||
@registrar1.api_users.should include(@contact.creator)
|
||||
@contact.ident.should == '37605030299'
|
||||
@contact.address.street.should == '123 Example'
|
||||
@contact.street.should == '123 Example'
|
||||
@contact.legal_documents.count.should == 1
|
||||
|
||||
log = ApiLog::EppLog.last
|
||||
|
@ -397,7 +403,7 @@ describe 'EPP Contact', epp: true do
|
|||
|
||||
it 'fails if contact has associated domain' do
|
||||
@domain = Fabricate(:domain, registrar: @registrar1, owner_contact: @contact)
|
||||
@domain.owner_contact.address.present?.should == true
|
||||
@domain.owner_contact.present?.should == true
|
||||
|
||||
response = delete_request
|
||||
response[:msg].should == 'Object association prohibits operation [domains]'
|
||||
|
@ -480,8 +486,7 @@ describe 'EPP Contact', epp: true do
|
|||
|
||||
it 'return info about contact' do
|
||||
@registrar1_contact = Fabricate(
|
||||
:contact, code: 'info-4444', registrar: @registrar1,
|
||||
name: 'Johnny Awesome', address: Fabricate(:address))
|
||||
:contact, code: 'info-4444', registrar: @registrar1, name: 'Johnny Awesome')
|
||||
|
||||
response = info_request({ id: { value: @registrar1_contact.code } })
|
||||
response[:msg].should == 'Command completed successfully'
|
||||
|
@ -492,9 +497,8 @@ describe 'EPP Contact', epp: true do
|
|||
end
|
||||
|
||||
it 'should return ident in extension' do
|
||||
@registrar1_contact = Fabricate(
|
||||
:contact, code: 'info-ident', registrar: @registrar1,
|
||||
name: 'Johnny Awesome', address: Fabricate(:address))
|
||||
@registrar1_contact = Fabricate(:contact, code: 'info-ident',
|
||||
registrar: @registrar1, name: 'Johnny Awesome')
|
||||
|
||||
response = info_request({ id: { value: @registrar1_contact.code } })
|
||||
response[:msg].should == 'Command completed successfully'
|
||||
|
|
|
@ -30,12 +30,12 @@ describe 'EPP Domain', epp: true do
|
|||
]
|
||||
}), :xml)
|
||||
|
||||
response[:results][0][:result_code].should == '2303'
|
||||
response[:results][0][:msg].should == 'Contact was not found'
|
||||
response[:results][0][:result_code].should == '2303'
|
||||
response[:results][0][:value].should == 'sh1111'
|
||||
|
||||
response[:results][1][:result_code].should == '2303'
|
||||
response[:results][1][:msg].should == 'Contact was not found'
|
||||
response[:results][1][:result_code].should == '2303'
|
||||
response[:results][1][:value].should == 'sh2222'
|
||||
|
||||
response[:clTRID].should == 'ABC-12345'
|
||||
|
@ -95,8 +95,8 @@ describe 'EPP Domain', epp: true do
|
|||
response[:clTRID].should == 'ABC-12345'
|
||||
|
||||
d.registrar.name.should == 'registrar1'
|
||||
d.tech_contacts.count.should == 2
|
||||
d.admin_contacts.count.should == 1
|
||||
d.tech_contacts.count.should == 3
|
||||
d.admin_contacts.count.should == 2
|
||||
|
||||
d.nameservers.count.should == 2
|
||||
d.auth_info.should_not be_empty
|
||||
|
@ -674,7 +674,7 @@ describe 'EPP Domain', epp: true do
|
|||
})
|
||||
|
||||
response = epp_plain_request(xml, :xml)
|
||||
response[:msg].should == 'Admin contacts count must be between 1-10 [admin_contacts]'
|
||||
response[:msg].should == 'Admin contacts count must be between 1-10 [admin_domain_contacts]'
|
||||
response[:result_code].should == '2004'
|
||||
response[:clTRID].should == 'ABC-12345'
|
||||
|
||||
|
@ -1355,6 +1355,7 @@ describe 'EPP Domain', epp: true do
|
|||
]
|
||||
}), :xml)
|
||||
|
||||
response[:results][0][:msg].should == 'Command completed successfully'
|
||||
response[:results][0][:result_code].should == '1000'
|
||||
|
||||
d = Domain.last
|
||||
|
@ -1525,7 +1526,10 @@ describe 'EPP Domain', epp: true do
|
|||
]
|
||||
})
|
||||
|
||||
epp_plain_request(xml, :xml)
|
||||
response = epp_plain_request(xml, :xml)
|
||||
response[:results][0][:msg].should == 'Command completed successfully'
|
||||
response[:results][0][:result_code].should == '1000'
|
||||
|
||||
d = Domain.last
|
||||
d.dnskeys.count.should == 2
|
||||
|
||||
|
@ -1555,7 +1559,9 @@ describe 'EPP Domain', epp: true do
|
|||
]
|
||||
})
|
||||
|
||||
epp_plain_request(xml, :xml)
|
||||
response = epp_plain_request(xml, :xml)
|
||||
response[:results][0][:msg].should == 'Command completed successfully'
|
||||
response[:results][0][:result_code].should == '1000'
|
||||
|
||||
d.dnskeys.count.should == 1
|
||||
|
||||
|
@ -1872,6 +1878,7 @@ describe 'EPP Domain', epp: true do
|
|||
]
|
||||
}), :xml)
|
||||
|
||||
response[:msg].should == 'Command completed successfully'
|
||||
response[:result_code].should == '1000'
|
||||
|
||||
Domain.find_by(name: domain.name).should == nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue