mirror of
https://github.com/internetee/registry.git
synced 2025-07-01 16:53:37 +02:00
Contact info honors contact code
This commit is contained in:
parent
b0e5e73f6f
commit
4ea983c865
2 changed files with 16 additions and 1 deletions
|
@ -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?
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue