Test contact + nameservers uniqueness

This commit is contained in:
Martin Lensment 2015-01-21 17:36:10 +02:00
parent 20be38fd0b
commit ce91341fa2
3 changed files with 344 additions and 381 deletions

View file

@ -142,9 +142,9 @@ en:
attributes: attributes:
contact: contact:
blank: 'Contact was not found' blank: 'Contact was not found'
taken: 'Contact already exists on this domain!' taken: 'Contact already exists on this domain'
contact_code_cache: contact_code_cache:
taken: 'Contact already exists on this domain!' taken: 'Contact already exists on this domain'
domain_status: domain_status:
attributes: attributes:
@ -315,7 +315,7 @@ en:
back_to_domain: 'Back to domain' back_to_domain: 'Back to domain'
edit_domain: 'Edit domain' edit_domain: 'Edit domain'
contact_was_not_found: 'Contact was not found!' contact_was_not_found: 'Contact was not found!'
contact_already_exists: 'Contact already exists on this domain!' contact_already_exists: 'Contact already exists on this domain'
failed_to_add_contact: 'Failed to add contact!' failed_to_add_contact: 'Failed to add contact!'
contact_added: 'Contact added!' contact_added: 'Contact added!'
contact_detached: 'Contact detached!' contact_detached: 'Contact detached!'

File diff suppressed because it is too large Load diff

View file

@ -1126,7 +1126,7 @@ describe 'EPP Domain', epp: true do
expect(response[:results][1][:value]).to eq('ns2.example.com') expect(response[:results][1][:value]).to eq('ns2.example.com')
expect(response[:results][2][:result_code]).to eq('2302') expect(response[:results][2][:result_code]).to eq('2302')
expect(response[:results][2][:msg]).to eq('Contact already exists on this domain!') expect(response[:results][2][:msg]).to eq('Contact already exists on this domain')
expect(response[:results][2][:value]).to eq('mak21') expect(response[:results][2][:value]).to eq('mak21')
expect(response[:results][3][:msg]).to eq('Status already exists on this domain') expect(response[:results][3][:msg]).to eq('Status already exists on this domain')
@ -1265,18 +1265,23 @@ describe 'EPP Domain', epp: true do
end end
it 'does not add duplicate objects to domain' do it 'does not add duplicate objects to domain' do
Fabricate(:contact, code: 'mak21') d = Domain.first
c = d.admin_contacts.first
n = d.nameservers.first
xml = domain_update_xml({ xml = domain_update_xml({
add: [ add: {
ns: [ ns: [
{ {
hostAttr: [ hostAttr: [
{ hostName: { value: 'ns1.example.com' } } { hostName: { value: n.hostname } }
] ]
} }
],
_anonymus: [
{ contact: { value: c.code, attrs: { type: 'admin' } } }
] ]
] }
}) })
epp_request(xml, :xml) epp_request(xml, :xml)
@ -1284,7 +1289,11 @@ describe 'EPP Domain', epp: true do
expect(response[:results][0][:result_code]).to eq('2302') expect(response[:results][0][:result_code]).to eq('2302')
expect(response[:results][0][:msg]).to eq('Nameserver already exists on this domain') expect(response[:results][0][:msg]).to eq('Nameserver already exists on this domain')
expect(response[:results][0][:value]).to eq('ns1.example.com') expect(response[:results][0][:value]).to eq(n.hostname)
expect(response[:results][1][:result_code]).to eq('2302')
expect(response[:results][1][:msg]).to eq('Contact already exists on this domain')
expect(response[:results][1][:value]).to eq(c.code)
end end
it 'cannot change registrant without legal document' do it 'cannot change registrant without legal document' do