From 2bfbf5f4ea9d36258329ba9431f0240518bdc4b7 Mon Sep 17 00:00:00 2001 From: Priit Tark Date: Wed, 6 May 2015 15:57:14 +0300 Subject: [PATCH] Should honor legacy CID and add registrar prefix --- app/models/contact.rb | 1 - spec/epp/contact_spec.rb | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/models/contact.rb b/app/models/contact.rb index 9ad8a1223..9dc79e1df 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -118,7 +118,6 @@ class Contact < ActiveRecord::Base # custom code from client # add prefix when needed if code.present? - code.sub!(/^CID:/, '') prefix, *custom_code = code.split(':') code = custom_code.join(':') if prefix == registrar.code end diff --git a/spec/epp/contact_spec.rb b/spec/epp/contact_spec.rb index fa6696795..415669f30 100644 --- a/spec/epp/contact_spec.rb +++ b/spec/epp/contact_spec.rb @@ -164,12 +164,12 @@ describe 'EPP Contact', epp: true do response[:result_code].should == '2005' end - it 'should not add registrar prefix for code when legacy prefix present' do + it 'should add registrar prefix for code when legacy prefix present' do response = create_request({ id: { value: 'CID:FIRST0:abc:ABC:NEW:12345' } }) response[:msg].should == 'Command completed successfully' response[:result_code].should == '1000' - Contact.last.code.should == 'FIRST0:ABC:ABC:NEW:12345' + Contact.last.code.should == 'FIRST0:CID:FIRST0:ABC:ABC:NEW:12345' end it 'should not remove suffix CID' do