mirror of
https://github.com/internetee/registry.git
synced 2025-05-19 10:49:39 +02:00
contact generates code if custom code is empty
This commit is contained in:
parent
c898ad57f5
commit
251231cf3f
2 changed files with 19 additions and 1 deletions
|
@ -42,7 +42,7 @@ class Epp::Contact < Contact
|
|||
return super if frame.blank?
|
||||
|
||||
custom_code =
|
||||
if frame.css('id').present?
|
||||
if frame.css('id').text.present?
|
||||
"#{registrar.code}:#{frame.css('id').text.parameterize}"
|
||||
else
|
||||
nil
|
||||
|
|
|
@ -145,6 +145,24 @@ describe 'EPP Contact', epp: true do
|
|||
Contact.last.code.should == 'registrar1:12345'
|
||||
end
|
||||
|
||||
it 'should generate server id when id is empty' do
|
||||
response = create_request({ id: { value: '' } })
|
||||
|
||||
response[:msg].should == 'Command completed successfully'
|
||||
response[:result_code].should == '1000'
|
||||
|
||||
Contact.last.code.should_not == 'registrar1:'
|
||||
end
|
||||
|
||||
it 'should generate server id when id is empty' do
|
||||
response = create_request
|
||||
|
||||
response[:msg].should == 'Command completed successfully'
|
||||
response[:result_code].should == '1000'
|
||||
|
||||
Contact.last.code.should_not == 'registrar1:'
|
||||
end
|
||||
|
||||
it 'should return parameter value policy error for org' do
|
||||
response = create_request({ postalInfo: { org: { value: 'should not save' } } })
|
||||
response[:msg].should ==
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue