mirror of
https://github.com/internetee/registry.git
synced 2025-07-25 20:18:22 +02:00
Better contact validation
This commit is contained in:
parent
c78e40a65a
commit
5003a3ff20
5 changed files with 53 additions and 5 deletions
|
@ -56,12 +56,13 @@ describe 'EPP Domain', epp: true do
|
|||
end
|
||||
|
||||
context 'with juridical persion as an owner' do
|
||||
before(:each) { Fabricate(:contact, code: 'jd1234', ident_type: 'ico')}
|
||||
|
||||
it 'creates a domain with contacts' do
|
||||
before(:each) {
|
||||
Fabricate(:contact, code: 'sh8013')
|
||||
Fabricate(:contact, code: 'sh801333')
|
||||
Fabricate(:contact, code: 'jd1234', ident_type: 'ico')
|
||||
}
|
||||
|
||||
it 'creates a domain with contacts' do
|
||||
response = epp_request('domains/create_wo_tech_contact.xml')
|
||||
expect(response[:result_code]).to eq('1000')
|
||||
expect(response[:msg]).to eq('Command completed successfully')
|
||||
|
@ -73,6 +74,16 @@ describe 'EPP Domain', epp: true do
|
|||
tech_contact = Domain.first.tech_contacts.first
|
||||
expect(tech_contact.code).to eq('jd1234')
|
||||
end
|
||||
|
||||
it 'does not create a domain without admin contact' do
|
||||
response = epp_request('domains/create_wo_contacts.xml')
|
||||
expect(response[:result_code]).to eq('2306')
|
||||
expect(response[:msg]).to eq('Required parameter missing - admin contact')
|
||||
expect(response[:clTRID]).to eq('ABC-12345')
|
||||
|
||||
expect(Domain.count).to eq 0
|
||||
expect(DomainContact.count).to eq 0
|
||||
end
|
||||
end
|
||||
|
||||
it 'checks a domain' do
|
||||
|
|
21
spec/epp/requests/domains/create_wo_contacts.xml
Normal file
21
spec/epp/requests/domains/create_wo_contacts.xml
Normal file
|
@ -0,0 +1,21 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
|
||||
<command>
|
||||
<create>
|
||||
<domain:create
|
||||
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
|
||||
<domain:name>example.ee</domain:name>
|
||||
<domain:period unit="y">1</domain:period>
|
||||
<domain:ns>
|
||||
<domain:hostObj>ns1.example.net</domain:hostObj>
|
||||
<domain:hostObj>ns2.example.net</domain:hostObj>
|
||||
</domain:ns>
|
||||
<domain:registrant>jd1234</domain:registrant>
|
||||
<domain:authInfo>
|
||||
<domain:pw>2fooBAR</domain:pw>
|
||||
</domain:authInfo>
|
||||
</domain:create>
|
||||
</create>
|
||||
<clTRID>ABC-12345</clTRID>
|
||||
</command>
|
||||
</epp>
|
Loading…
Add table
Add a link
Reference in a new issue