Merge branch 'master' of github.com:internetee/registry

Conflicts:
	app/models/domain.rb
	app/models/epp/epp_domain.rb
	config/locales/en.yml
	spec/epp/domain_spec.rb
This commit is contained in:
Martin Lensment 2014-10-13 10:37:26 +03:00
commit ee2d93128c
50 changed files with 528 additions and 201 deletions

View file

@ -33,7 +33,7 @@ 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(response[:clTRID]).to eq('ABC-12345')
expect(Contact.first.created_by_id).to eq 2
expect(Contact.first.updated_by_id).to eq nil
@ -126,7 +126,14 @@ describe 'EPP Contact', epp: true do
end
it 'is succesful' do
Fabricate(:contact, created_by_id: 1, registrar: zone, email: 'not_updated@test.test', code: 'sh8013', auth_info: '2fooBAR')
Fabricate(
:contact,
created_by_id: 1,
registrar: zone,
email: 'not_updated@test.test',
code: 'sh8013',
auth_info: '2fooBAR'
)
response = epp_request('contacts/update.xml')
expect(response[:msg]).to eq('Command completed successfully')
@ -137,7 +144,14 @@ describe 'EPP Contact', epp: true do
end
it 'returns phone and email error' do
Fabricate(:contact, registrar: zone, created_by_id: 1, email: 'not_updated@test.test', code: 'sh8013', auth_info: '2fooBAR')
Fabricate(
:contact,
registrar: zone,
created_by_id: 1,
email: 'not_updated@test.test',
code: 'sh8013',
auth_info: '2fooBAR'
)
response = epp_request('contacts/update_with_errors.xml')
@ -185,7 +199,15 @@ describe 'EPP Contact', epp: true do
end
it 'fails if contact has associated domain' do
Fabricate(:domain, owner_contact: Fabricate(:contact, code: 'dwa1234', created_by_id: zone.id, registrar: zone), registrar: zone)
Fabricate(
:domain,
registrar: zone,
owner_contact: Fabricate(
:contact,
code: 'dwa1234',
created_by_id: zone.id,
registrar: zone)
)
expect(Domain.first.owner_contact.address.present?).to be true
response = epp_request('contacts/delete.xml')

View file

@ -167,7 +167,7 @@ describe 'EPP Domain', epp: true do
it 'creates new pw after successful transfer' do
pw = domain.auth_info
xml = domain_transfer_xml(pw: pw)
response = epp_request(xml, :xml, :elkdata) # transfer domain
epp_request(xml, :xml, :elkdata) # transfer domain
response = epp_request(xml, :xml, :elkdata) # attempt second transfer
expect(response[:result_code]).to eq('2200')
expect(response[:msg]).to eq('Authentication error')
@ -278,7 +278,7 @@ describe 'EPP Domain', epp: true do
xml = domain_create_xml({
ns: [
{ hostObj: { value: 'invalid1-' } },
{ hostObj: { value: '-invalid2' } },
{ hostObj: { value: '-invalid2' } }
]
})
@ -607,12 +607,12 @@ describe 'EPP Domain', epp: true do
expect(inf_data.css('status').first[:s]).to eq('clientHold')
expect(inf_data.css('registrant').text).to eq(d.owner_contact_code)
admin_contacts_from_request = inf_data.css('contact[type="admin"]').map { |x| x.text }
admin_contacts_from_request = inf_data.css('contact[type="admin"]').map(&:text)
admin_contacts_existing = d.admin_contacts.pluck(:code)
expect(admin_contacts_from_request).to eq(admin_contacts_existing)
hosts_from_request = inf_data.css('hostObj').map { |x| x.text }
hosts_from_request = inf_data.css('hostObj').map(&:text)
hosts_existing = d.nameservers.where(ipv4: nil).pluck(:hostname)
expect(hosts_from_request).to eq(hosts_existing)

View file

@ -76,16 +76,16 @@ describe 'EPP Helper', epp: true do
xml = domain_create_xml({
name: { value: 'one.ee' },
period: {value: '345', attrs: { unit: 'd' } },
period: { value: '345', attrs: { unit: 'd' } },
ns: [
{ hostObj: {value: 'ns1.test.net' } },
{ hostObj: {value: 'ns2.test.net' } }
{ hostObj: { value: 'ns1.test.net' } },
{ hostObj: { value: 'ns2.test.net' } }
],
registrant: { value: '32fsdaf' },
_other: [
{ contact: {value: '2323rafaf', attrs: { type: 'admin' } } },
{ contact: {value: '3dgxx', attrs: { type: 'tech' } } },
{ contact: {value: '345xxv', attrs: { type: 'tech' } } }
{ contact: { value: '2323rafaf', attrs: { type: 'admin' } } },
{ contact: { value: '3dgxx', attrs: { type: 'tech' } } },
{ contact: { value: '345xxv', attrs: { type: 'tech' } } }
]
})
@ -455,7 +455,6 @@ describe 'EPP Helper', epp: true do
generated = Nokogiri::XML(domain_delete_xml).to_s.squish
expect(generated).to eq(expected)
expected = Nokogiri::XML('<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<command>