diff --git a/app/views/epp/contacts/create.xml.builder b/app/views/epp/contacts/create.xml.builder index 8e96f27f0..da48d780c 100644 --- a/app/views/epp/contacts/create.xml.builder +++ b/app/views/epp/contacts/create.xml.builder @@ -7,7 +7,7 @@ xml.epp_head do xml.resData do xml.tag!('contact:creData', 'xmlns:contact' => 'urn:ietf:params:xml:ns:contact-1.0') do xml.tag!('contact:id', @contact.code) - xml.tag!('contact:crDate', @contact.created_at) + xml.tag!('contact:crDate', @contact.created_at.try(:iso8601)) end end diff --git a/app/views/epp/contacts/info.xml.builder b/app/views/epp/contacts/info.xml.builder index ce692020c..82edd64b8 100644 --- a/app/views/epp/contacts/info.xml.builder +++ b/app/views/epp/contacts/info.xml.builder @@ -29,10 +29,10 @@ xml.epp_head do xml.tag!('contact:clID', @contact.registrar.try(:name)) xml.tag!('contact:crID', @contact.creator.try(:registrar)) - xml.tag!('contact:crDate', @contact.created_at) + xml.tag!('contact:crDate', @contact.created_at.try(:iso8601)) if @contact.updated_at != @contact.created_at xml.tag!('contact:upID', @contact.updator.try(:registrar)) - xml.tag!('contact:upDate', @contact.updated_at) + xml.tag!('contact:upDate', @contact.updated_at.try(:iso8601)) end # xml.tag!('contact:trDate', '123') if false if can? :view_password, @contact, @password diff --git a/app/views/epp/contacts/update.xml.builder b/app/views/epp/contacts/update.xml.builder index 8e96f27f0..da48d780c 100644 --- a/app/views/epp/contacts/update.xml.builder +++ b/app/views/epp/contacts/update.xml.builder @@ -7,7 +7,7 @@ xml.epp_head do xml.resData do xml.tag!('contact:creData', 'xmlns:contact' => 'urn:ietf:params:xml:ns:contact-1.0') do xml.tag!('contact:id', @contact.code) - xml.tag!('contact:crDate', @contact.created_at) + xml.tag!('contact:crDate', @contact.created_at.try(:iso8601)) end end diff --git a/app/views/epp/domains/create.xml.builder b/app/views/epp/domains/create.xml.builder index 6ccfda07b..ba6661504 100644 --- a/app/views/epp/domains/create.xml.builder +++ b/app/views/epp/domains/create.xml.builder @@ -7,8 +7,8 @@ xml.epp_head do xml.resData do xml.tag!('domain:creData', 'xmlns:domain' => 'urn:ietf:params:xml:ns:domain-1.0') do xml.tag!('domain:name', @domain.name) - xml.tag!('domain:crDate', @domain.created_at) - xml.tag!('domain:exDate', @domain.valid_to) + xml.tag!('domain:crDate', @domain.created_at.try(:iso8601)) + xml.tag!('domain:exDate', @domain.valid_to.try(:iso8601)) end end diff --git a/app/views/epp/domains/info.xml.builder b/app/views/epp/domains/info.xml.builder index 57d4903f0..d4fc26036 100644 --- a/app/views/epp/domains/info.xml.builder +++ b/app/views/epp/domains/info.xml.builder @@ -40,14 +40,14 @@ xml.epp_head do xml.tag!('domain:crID', @domain.creator.try(:registrar)) - xml.tag!('domain:crDate', @domain.created_at) + xml.tag!('domain:crDate', @domain.created_at.try(:iso8601)) - xml.tag!('domain:exDate', @domain.valid_to) + xml.tag!('domain:exDate', @domain.valid_to.try(:iso8601)) # TODO Make domain stampable #xml.tag!('domain:upID', @domain.updated_by) - xml.tag!('domain:upDate', @domain.updated_at) if @domain.updated_at != @domain.created_at + xml.tag!('domain:upDate', @domain.updated_at.try(:iso8601)) if @domain.updated_at != @domain.created_at # TODO Make domain transferrable #xml.tag!('domain:trDate', @domain.transferred_at) if @domain.transferred_at diff --git a/app/views/epp/domains/partials/_transfer.xml.builder b/app/views/epp/domains/partials/_transfer.xml.builder index 893cd7c2e..39f9b147f 100644 --- a/app/views/epp/domains/partials/_transfer.xml.builder +++ b/app/views/epp/domains/partials/_transfer.xml.builder @@ -2,8 +2,8 @@ builder.tag!('domain:trnData', 'xmlns:domain' => 'urn:ietf:params:xml:ns:domain- builder.tag!('domain:name', dt.domain_name) builder.tag!('domain:trStatus', dt.status) builder.tag!('domain:reID', dt.transfer_to.code) - builder.tag!('domain:reDate', dt.transfer_requested_at) + builder.tag!('domain:reDate', dt.transfer_requested_at.try(:iso8601)) builder.tag!('domain:acID', dt.transfer_from.code) - builder.tag!('domain:acDate', dt.transferred_at || dt.wait_until) - builder.tag!('domain:exDate', dt.domain_valid_to) + builder.tag!('domain:acDate', dt.transferred_at.try(:iso8601) || dt.wait_until.try(:iso8601)) + builder.tag!('domain:exDate', dt.domain_valid_to.try(:iso8601)) end diff --git a/app/views/epp/domains/renew.xml.builder b/app/views/epp/domains/renew.xml.builder index f1d2a7742..ea2192c18 100644 --- a/app/views/epp/domains/renew.xml.builder +++ b/app/views/epp/domains/renew.xml.builder @@ -7,7 +7,7 @@ xml.epp_head do xml.resData do xml.tag!('domain:renData', 'xmlns:domain' => 'urn:ietf:params:xml:ns:domain-1.0') do xml.tag!('domain:name', @domain[:name]) - xml.tag!('domain:exDate', @domain.valid_to) + xml.tag!('domain:exDate', @domain.valid_to.try(:iso8601)) end end diff --git a/app/views/epp/poll/poll_keyrelay.xml.builder b/app/views/epp/poll/poll_keyrelay.xml.builder index 4189c6e82..5b037702a 100644 --- a/app/views/epp/poll/poll_keyrelay.xml.builder +++ b/app/views/epp/poll/poll_keyrelay.xml.builder @@ -11,7 +11,7 @@ xml.epp( end xml.tag!('msgQ', 'count' => current_user.queued_messages.count, 'id' => @message.id) do - xml.qDate @message.created_at + xml.qDate @message.created_at.try(:iso8601) xml.msg @message.body end @@ -19,7 +19,7 @@ xml.epp( xml.tag!('keyrelay:response') do xml.tag!('keyrelay:panData') do xml.tag!('keyrelay:name', @object.domain_name) - xml.tag!('keyrelay:paDate', @object.pa_date) + xml.tag!('keyrelay:paDate', @object.pa_date.try(:iso8601)) xml.tag!('keyrelay:keyData') do xml.tag!('secDNS:flags', @object.key_data_flags) diff --git a/app/views/epp/poll/poll_req.xml.builder b/app/views/epp/poll/poll_req.xml.builder index b79ba160b..347f0a632 100644 --- a/app/views/epp/poll/poll_req.xml.builder +++ b/app/views/epp/poll/poll_req.xml.builder @@ -5,7 +5,7 @@ xml.epp_head do end xml.tag!('msgQ', 'count' => current_user.queued_messages.count, 'id' => @message.id) do - xml.qDate @message.created_at + xml.qDate @message.created_at.try(:iso8601) xml.msg @message.body end diff --git a/spec/epp/contact_spec.rb b/spec/epp/contact_spec.rb index 2d92329a4..19a0a3d0d 100644 --- a/spec/epp/contact_spec.rb +++ b/spec/epp/contact_spec.rb @@ -51,19 +51,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 == + response[:results][2][:msg].should == 'Required parameter missing: create > create > postalInfo > addr > city [city]' - response[:results][3][:msg].should == + response[:results][3][:msg].should == 'Required parameter missing: create > create > postalInfo > addr > pc [pc]' - response[:results][4][:msg].should == + response[:results][4][:msg].should == 'Required parameter missing: create > create > postalInfo > addr > cc [cc]' - response[:results][5][:msg].should == + response[:results][5][:msg].should == 'Required parameter missing: create > create > voice [voice]' - response[:results][6][:msg].should == + response[:results][6][:msg].should == 'Required parameter missing: create > create > email [email]' - response[:results][7][:msg].should == + response[:results][7][:msg].should == 'Required parameter missing: extension > extdata > ident [ident]' response[:results][0][:result_code].should == '2003' @@ -299,7 +299,7 @@ describe 'EPP Contact', epp: true do response = update_request({ id: { value: 'FIRST0:SH8013' } }) response[:msg].should == 'Command completed successfully' - + @contact.reload @contact.name.should == 'John Doe Edited' @contact.email.should == 'edited@example.example' @@ -629,12 +629,12 @@ describe 'EPP Contact', epp: true do id: { value: 'FIRST0:SH8013' }, authInfo: { pw: { value: 'password' } }, rem: { - postalInfo: { org: { value: 'not important' } } + postalInfo: { org: { value: 'not important' } } } }) response = epp_plain_request(xml, :xml) - response[:results][0][:msg].should == + response[:results][0][:msg].should == 'Parameter value policy error. Org must be blank: postalInfo > org [org]' response[:results][0][:result_code].should == '2306' end @@ -644,7 +644,7 @@ describe 'EPP Contact', epp: true do id: { value: 'FIRST0:SH8013' }, authInfo: { pw: { value: 'password' } }, rem: { - postalInfo: { + postalInfo: { name: { value: 'not important' } } } diff --git a/spec/epp/domain_spec.rb b/spec/epp/domain_spec.rb index b886e229e..0440e6995 100644 --- a/spec/epp/domain_spec.rb +++ b/spec/epp/domain_spec.rb @@ -88,8 +88,8 @@ describe 'EPP Domain', epp: true do cre_data = response[:parsed].css('creData') cre_data.css('name').text.should == dn - cre_data.css('crDate').text.should == d.created_at.to_time.utc.to_s - cre_data.css('exDate').text.should == d.valid_to.to_time.utc.to_s + cre_data.css('crDate').text.should == d.created_at.to_time.utc.iso8601 + cre_data.css('exDate').text.should == d.valid_to.to_time.utc.iso8601 response[:clTRID].should == 'ABC-12345' @@ -733,10 +733,10 @@ describe 'EPP Domain', epp: true do trn_data.css('name').text.should == domain.name trn_data.css('trStatus').text.should == 'serverApproved' trn_data.css('reID').text.should == 'REGDOMAIN2' - trn_data.css('reDate').text.should == dtl.transfer_requested_at.to_time.utc.to_s + trn_data.css('reDate').text.should == dtl.transfer_requested_at.to_time.utc.iso8601 trn_data.css('acID').text.should == 'REGDOMAIN1' - trn_data.css('acDate').text.should == dtl.transferred_at.to_time.utc.to_s - trn_data.css('exDate').text.should == domain.valid_to.to_time.utc.to_s + trn_data.css('acDate').text.should == dtl.transferred_at.to_time.utc.iso8601 + trn_data.css('exDate').text.should == domain.valid_to.to_time.utc.iso8601 domain.registrar.should == @registrar2 @@ -777,10 +777,10 @@ describe 'EPP Domain', epp: true do trn_data.css('name').text.should == domain.name trn_data.css('trStatus').text.should == 'pending' trn_data.css('reID').text.should == 'REGDOMAIN1' - trn_data.css('reDate').text.should == dtl.transfer_requested_at.to_time.utc.to_s - trn_data.css('acDate').text.should == dtl.wait_until.to_time.utc.to_s + trn_data.css('reDate').text.should == dtl.transfer_requested_at.to_time.utc.iso8601 + trn_data.css('acDate').text.should == dtl.wait_until.to_time.utc.iso8601 trn_data.css('acID').text.should == 'REGDOMAIN2' - trn_data.css('exDate').text.should == domain.valid_to.to_time.utc.to_s + trn_data.css('exDate').text.should == domain.valid_to.to_time.utc.iso8601 domain.registrar.should == @registrar2 @@ -792,10 +792,10 @@ describe 'EPP Domain', epp: true do trn_data.css('name').text.should == domain.name trn_data.css('trStatus').text.should == 'pending' trn_data.css('reID').text.should == 'REGDOMAIN1' - trn_data.css('reDate').text.should == dtl.transfer_requested_at.to_time.utc.to_s - trn_data.css('acDate').text.should == dtl.wait_until.to_time.utc.to_s + trn_data.css('reDate').text.should == dtl.transfer_requested_at.to_time.utc.iso8601 + trn_data.css('acDate').text.should == dtl.wait_until.to_time.utc.iso8601 trn_data.css('acID').text.should == 'REGDOMAIN2' - trn_data.css('exDate').text.should == domain.valid_to.to_time.utc.to_s + trn_data.css('exDate').text.should == domain.valid_to.to_time.utc.iso8601 domain.registrar.should == @registrar2 @@ -1199,9 +1199,9 @@ describe 'EPP Domain', epp: true do trn_data.css('name').text.should == domain.name trn_data.css('trStatus').text.should == 'clientApproved' trn_data.css('reID').text.should == 'REGDOMAIN2' - trn_data.css('reDate').text.should == dtl.transfer_requested_at.to_time.utc.to_s + trn_data.css('reDate').text.should == dtl.transfer_requested_at.to_time.utc.iso8601 trn_data.css('acID').text.should == 'REGDOMAIN1' - trn_data.css('exDate').text.should == domain.valid_to.to_time.utc.to_s + trn_data.css('exDate').text.should == domain.valid_to.to_time.utc.iso8601 end it 'rejects a domain transfer' do @@ -1870,7 +1870,7 @@ describe 'EPP Domain', epp: true do ex_date = response[:parsed].css('renData exDate').text name = response[:parsed].css('renData name').text - ex_date.should == "#{(exp_date + 1.year)} 00:00:00 UTC" + ex_date.should == "#{(exp_date + 1.year)}T00:00:00Z" name.should == domain.name end @@ -1957,8 +1957,8 @@ describe 'EPP Domain', epp: true do ns1.css('hostName').last.text.should == 'ns1.example.com' ns1.css('hostAddr').first.text.should == '192.168.1.1' ns1.css('hostAddr').last.text.should == '1080:0:0:0:8:800:200C:417A' - inf_data.css('crDate').text.should == domain.created_at.to_time.utc.to_s - inf_data.css('exDate').text.should == domain.valid_to.to_time.utc.to_s + inf_data.css('crDate').text.should == domain.created_at.to_time.utc.iso8601 + inf_data.css('exDate').text.should == domain.valid_to.to_time.utc.iso8601 inf_data.css('pw').text.should == domain.auth_info ds_data_1 = response[:parsed].css('dsData')[0] @@ -1987,7 +1987,7 @@ describe 'EPP Domain', epp: true do response = epp_plain_request(domain_info_xml(name: { value: domain.name }), :xml) inf_data = response[:parsed].css('resData infData') - inf_data.css('upDate').text.should == domain.updated_at.to_time.utc.to_s + inf_data.css('upDate').text.should == domain.updated_at.to_time.utc.iso8601 end it 'returns domain info with different nameservers' do