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

This commit is contained in:
Martin Lensment 2015-06-09 15:21:54 +03:00
commit 412f154359
4 changed files with 16 additions and 6 deletions

View file

@ -118,6 +118,9 @@ class Epp::ContactsController < EppController
contact_org_disabled contact_org_disabled
fax_disabled fax_disabled
status_editing_disabled status_editing_disabled
if params[:parsed_frame].css('ident').present?
epp_errors << { code: '2306', msg: "#{I18n.t(:ident_update_error)} [ident]" }
end
requires 'id' requires 'id'
@prefix = nil @prefix = nil
end end

View file

@ -143,7 +143,6 @@ class Epp::Contact < Contact
at.deep_merge!(self.class.attrs_from(frame.css('rem'), 'rem')) at.deep_merge!(self.class.attrs_from(frame.css('rem'), 'rem'))
at.deep_merge!(self.class.attrs_from(frame.css('add'))) at.deep_merge!(self.class.attrs_from(frame.css('add')))
at.deep_merge!(self.class.attrs_from(frame.css('chg'))) at.deep_merge!(self.class.attrs_from(frame.css('chg')))
at.merge!(self.class.ident_attrs(frame.css('ident').first))
legal_frame = frame.css('legalDocument').first legal_frame = frame.css('legalDocument').first
at[:legal_documents_attributes] = self.class.legal_document_attrs(legal_frame) at[:legal_documents_attributes] = self.class.legal_document_attrs(legal_frame)
self.deliver_emails = true # turn on email delivery for epp self.deliver_emails = true # turn on email delivery for epp

View file

@ -505,6 +505,7 @@ en:
crt_revoked: 'CRT (revoked)' crt_revoked: 'CRT (revoked)'
contact_org_error: 'Parameter value policy error. Org must be blank' contact_org_error: 'Parameter value policy error. Org must be blank'
contact_fax_error: 'Parameter value policy error. Fax must be blank' contact_fax_error: 'Parameter value policy error. Fax must be blank'
ident_update_error: 'Parameter value policy error. Update of ident data not allowed'
invoices: 'Invoices' invoices: 'Invoices'
no_such_user: 'No such user' no_such_user: 'No such user'
log_in: 'Log in' log_in: 'Log in'

View file

@ -24,6 +24,12 @@ describe 'EPP Contact', epp: true do
attrs: { type: 'pdf' } attrs: { type: 'pdf' }
} }
} }
@update_extension = {
legalDocument: {
value: 'dGVzdCBmYWlsCg==',
attrs: { type: 'pdf' }
}
}
end end
context 'with valid user' do context 'with valid user' do
@ -272,7 +278,7 @@ describe 'EPP Contact', epp: true do
end end
def update_request(overwrites = {}, extension = {}, options = {}) def update_request(overwrites = {}, extension = {}, options = {})
extension = @extension if extension.blank? extension = @update_extension if extension.blank?
defaults = { defaults = {
id: { value: 'asd123123er' }, id: { value: 'asd123123er' },
@ -394,7 +400,7 @@ describe 'EPP Contact', epp: true do
@contact.reload.code.should == 'FIRST0:SH8013' @contact.reload.code.should == 'FIRST0:SH8013'
end end
it 'should update ident' do it 'should not be able to update ident' do
extension = { extension = {
ident: { ident: {
value: '1990-22-12', value: '1990-22-12',
@ -406,10 +412,11 @@ describe 'EPP Contact', epp: true do
} }
} }
response = update_request({ id: { value: 'FIRST0:SH8013' } }, extension) response = update_request({ id: { value: 'FIRST0:SH8013' } }, extension)
response[:msg].should == 'Command completed successfully' response[:msg].should ==
response[:result_code].should == '1000' 'Parameter value policy error. Update of ident data not allowed [ident]'
response[:result_code].should == '2306'
Contact.find_by(code: 'FIRST0:SH8013').ident_type.should == 'birthday' Contact.find_by(code: 'FIRST0:SH8013').ident_type.should == 'priv'
end end
it 'should return parameter value policy errror for org update' do it 'should return parameter value policy errror for org update' do