Contact info honors contact code

This commit is contained in:
Priit Tark 2015-05-05 14:10:31 +03:00
parent b0e5e73f6f
commit 4ea983c865
2 changed files with 16 additions and 1 deletions

View file

@ -59,7 +59,7 @@ class Epp::ContactsController < EppController
end end
def find_contact def find_contact
code = params[:parsed_frame].css('id').text.strip.downcase code = params[:parsed_frame].css('id').text.strip
@contact = Epp::Contact.find_by(code: code) @contact = Epp::Contact.find_by(code: code)
if @contact.blank? if @contact.blank?

View file

@ -851,6 +851,21 @@ describe 'EPP Contact', epp: true do
response[:results].count.should == 1 response[:results].count.should == 1
end end
it 'should honor new contact code format' do
@registrar1_contact = Fabricate(:contact, code: 'REGISTRAR1:test:custom:code')
@registrar1_contact.code.should == 'REGISTRAR1:test:custom:code'
response = info_request({ id: { value: 'REGISTRAR1:test:custom:code' } })
response[:msg].should == 'Command completed successfully'
response[:result_code].should == '1000'
contact = response[:parsed].css('resData infData')
contact.css('ident').first.should == nil # ident should be in extension
contact = response[:parsed].css('extension')
contact.css('ident').first.text.should == '37605030299'
end
it 'returns no authorization error for wrong user but correct password' do it 'returns no authorization error for wrong user but correct password' do
login_as :registrar2 do login_as :registrar2 do
response = info_request response = info_request