Honor legacy domains without versions #2778

This commit is contained in:
Priit Tark 2015-07-20 17:19:25 +03:00
parent 4b1bf92a27
commit c10ad96947
2 changed files with 116 additions and 109 deletions

View file

@ -1,24 +1,25 @@
- children = HashWithIndifferentAccess.new(version.children) - if version.present? && domain.present?
- nameservers = children[:nameservers] || [] - children = HashWithIndifferentAccess.new(version.children)
- tech_contacts = children[:tech_contacts] || [] - nameservers = children[:nameservers] || []
- admin_contacts = children[:admin_contacts] || [] - tech_contacts = children[:tech_contacts] || []
- registrant = children[:registrant] || [] - admin_contacts = children[:admin_contacts] || []
- registrant = children[:registrant] || []
%td %td
%p.nowrap %p.nowrap
= l(domain.updated_at, format: :short) = l(domain.updated_at, format: :short)
= version.event = version.event
%p.text-right %p.text-right
= version.terminator = version.terminator
%td %td
%p %p
= "#{domain.period}#{domain.period_unit}" = "#{domain.period}#{domain.period_unit}"
= "#{l(domain.valid_from, format: :date)} - #{l(domain.valid_to, format: :date)}" = "#{l(domain.valid_from, format: :date)} - #{l(domain.valid_to, format: :date)}"
%p %p
= domain.status = domain.status
%td %td
- registrant.each do |oc| - registrant.each do |oc|
%p %p
= oc[:name] = oc[:name]
@ -27,7 +28,7 @@
%p %p
= oc[:code] = oc[:code]
%td %td
- admin_contacts.each do |ac| - admin_contacts.each do |ac|
%p %p
= ac[:name] = ac[:name]
@ -36,7 +37,7 @@
%p %p
= ac[:code] = ac[:code]
%td %td
- tech_contacts.each do |tc| - tech_contacts.each do |tc|
%p %p
= tc[:name] = tc[:name]
@ -45,7 +46,7 @@
%p %p
= tc[:code] = tc[:code]
%td %td
- nameservers.each do |ns| - nameservers.each do |ns|
%p %p
= ns[:hostname] = ns[:hostname]
@ -53,14 +54,14 @@
= ns[:ipv4] = ns[:ipv4]
= ns[:ipv6] = ns[:ipv6]
%td %td
%p %p
= domain.registrar.name = domain.registrar.name
-# %td -# %td
-# = version.children.inspect -# = version.children.inspect
-# %td{ class: changes.include?(:domain) ? 'edit-highlight' : 'no-highlight' } -# %td{ class: changes.include?(:domain) ? 'edit-highlight' : 'no-highlight' }
-# - if children[:domain] -# - if children[:domain]
-# %p{:style => "font-size:x-small;"} -# %p{:style => "font-size:x-small;"}
-# = children[:domain][:period] -# = children[:domain][:period]
@ -75,7 +76,7 @@
-# = ',' + children[:domain][:status] -# = ',' + children[:domain][:status]
-# %td{ class: changes.include?(:registrant) ? 'edit-highlight' : 'no-highlight' } -# %td{ class: changes.include?(:registrant) ? 'edit-highlight' : 'no-highlight' }
-# - if children[:registrant] -# - if children[:registrant]
-# %p{:style => "font-size:x-small;"} -# %p{:style => "font-size:x-small;"}
-# = children[:registrant][:name] -# = children[:registrant][:name]
@ -86,7 +87,7 @@
-# = "," -# = ","
-# = children[:registrant][:code] -# = children[:registrant][:code]
-# %td{ class: changes.include?(:admin_contacts) ? 'edit-highlight' : 'no-highlight' } -# %td{ class: changes.include?(:admin_contacts) ? 'edit-highlight' : 'no-highlight' }
-# - if children[:admin_contacts] -# - if children[:admin_contacts]
-# - children[:admin_contacts].each do |ac| -# - children[:admin_contacts].each do |ac|
-# %p{:style => "font-size:x-small;"} -# %p{:style => "font-size:x-small;"}
@ -98,7 +99,7 @@
-# = "," -# = ","
-# = ac[:code] -# = ac[:code]
-# %td{ class: changes.include?(:tech_contacts) ? 'edit-highlight' : 'no-highlight' } -# %td{ class: changes.include?(:tech_contacts) ? 'edit-highlight' : 'no-highlight' }
-# - if children[:tech_contacts] -# - if children[:tech_contacts]
-# - children[:tech_contacts].each do |tc| -# - children[:tech_contacts].each do |tc|
-# %p{:style => "font-size:x-small;"} -# %p{:style => "font-size:x-small;"}
@ -110,7 +111,7 @@
-# = "," -# = ","
-# = tc[:code] -# = tc[:code]
-# %td{ class: changes.include?(:nameservers) ? 'edit-highlight' : 'no-highlight' } -# %td{ class: changes.include?(:nameservers) ? 'edit-highlight' : 'no-highlight' }
-# - if children[:nameservers] -# - if children[:nameservers]
-# - children[:nameservers].each do |ns| -# - children[:nameservers].each do |ns|
-# %p{:style => "font-size:x-small;"} -# %p{:style => "font-size:x-small;"}
@ -118,7 +119,7 @@
-# = "," -# = ","
-# = ns[:ipv4] || ns[:ipv6] -# = ns[:ipv4] || ns[:ipv6]
-# %td -# %td
-# %p{ :style => 'font-size:x-small;' } -# %p{ :style => 'font-size:x-small;' }
-# = l(version.created_at, format: :short) -# = l(version.created_at, format: :short)
-# = whodunnit_with_protocol(version.whodunnit) -# = whodunnit_with_protocol(version.whodunnit)

View file

@ -184,6 +184,12 @@ describe 'EPP Contact', epp: true do
response[:result_code].should == '2005' response[:result_code].should == '2005'
end end
fit 'should not allow spaces in custom code' do
response = create_request({ id: { value: '1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111' } })
response[:msg].should == 'is invalid [code]'
response[:result_code].should == '2005'
end
it 'should not saves ident type with wrong country code' do it 'should not saves ident type with wrong country code' do
extension = { extension = {
ident: { ident: {