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

This commit is contained in:
Priit Tark 2015-05-27 12:38:58 +03:00
commit fb42ec138e
4 changed files with 18 additions and 11 deletions

View file

@ -1,4 +1,4 @@
xml.trID do xml.trID do
xml.clTRID params[:clTRID] xml.clTRID params[:clTRID] if params[:clTRID].present?
xml.svTRID @svTRID xml.svTRID @svTRID
end end

View file

@ -1931,10 +1931,10 @@ describe 'EPP Domain', epp: true do
domain.save domain.save
xml = domain_info_xml(name: { value: domain.name }) xml = domain_info_xml(name: { value: domain.name })
response = epp_plain_request(xml, :xml) response = epp_plain_request(xml, :xml)
response[:results][0][:msg].should == 'Command completed successfully' response[:results][0][:msg].should == 'Command completed successfully'
response[:results][0][:result_code].should == '1000' response[:results][0][:result_code].should == '1000'
response[:clTRID].should be_nil
inf_data = response[:parsed].css('resData infData') inf_data = response[:parsed].css('resData infData')
inf_data.css('name').text.should == domain.name inf_data.css('name').text.should == domain.name

View file

@ -46,6 +46,13 @@ describe 'EPP Session', epp: true do
response[:clTRID].should == 'ABC-12345' response[:clTRID].should == 'ABC-12345'
end end
it 'should not have clTRID in response if client does not send it' do
epp_xml_no_cltrid = EppXml.new(cl_trid: '')
wrong_user = epp_xml_no_cltrid.session.login(clID: { value: 'wrong-user' }, pw: { value: 'ghyt9e4fu' })
response = epp_plain_request(wrong_user, :xml)
response[:clTRID].should be_nil
end
context 'with valid user' do context 'with valid user' do
it 'logs in epp user' do it 'logs in epp user' do
response = epp_plain_request(@login_xml_cache, :xml) response = epp_plain_request(@login_xml_cache, :xml)

View file

@ -89,7 +89,7 @@ module Epp
obj = { obj = {
results: [], results: [],
clTRID: res.css('epp trID clTRID').text, clTRID: res.css('epp trID clTRID').first.try(:text),
parsed: res.remove_namespaces!, parsed: res.remove_namespaces!,
raw: raw raw: raw
} }
@ -127,7 +127,7 @@ module Epp
xml_params = defaults.deep_merge(xml_params) xml_params = defaults.deep_merge(xml_params)
epp_xml = EppXml::Domain.new(cl_trid: 'ABC-12345') epp_xml = EppXml::Domain.new(cl_trid: '')
epp_xml.info(xml_params) epp_xml.info(xml_params)
end end