Remove auth info changing ability

This commit is contained in:
Martin Lensment 2014-09-04 12:01:23 +03:00
parent 1bf886a6bf
commit 1ebf7b5e21
3 changed files with 5 additions and 12 deletions

View file

@ -43,7 +43,6 @@ module Epp::DomainsHelper
@domain.parse_and_attach_domain_dependencies(@ph, parsed_frame.css('add'))
@domain.parse_and_detach_domain_dependencies(parsed_frame.css('rem'))
@domain.parse_and_update_domain_dependencies(parsed_frame.css('chg'))
@domain.parse_and_update_domain_attributes(parsed_frame.css('chg'))
if @domain.errors.any?
handle_errors(@domain)

View file

@ -76,8 +76,10 @@ class Domain < ActiveRecord::Base
errors.empty?
end
# TODO: Find out if there are any attributes that can be changed
# if not, delete this method
def parse_and_update_domain_attributes(parsed_frame)
assign_attributes(self.class.parse_update_params_from_frame(parsed_frame))
#assign_attributes(self.class.parse_update_params_from_frame(parsed_frame))
errors.empty?
end
@ -391,15 +393,6 @@ class Domain < ActiveRecord::Base
res
end
def parse_update_params_from_frame(parsed_frame)
ret = {}
return ret if parsed_frame.blank?
ret[:auth_info] = parsed_frame.css('pw').try(:text)
ret.compact
end
def check_availability(domains)
domains = [domains] if domains.is_a?(String)

View file

@ -488,6 +488,7 @@ describe 'EPP Domain', epp: true do
it 'updates a domain' do
Fabricate(:contact, code: 'mak21')
existing_pw = Domain.first.auth_info
xml_params = {
chg: [
@ -504,7 +505,7 @@ describe 'EPP Domain', epp: true do
d = Domain.last
expect(d.owner_contact_code).to eq('mak21')
expect(d.auth_info).to eq('2BARfoo')
expect(d.auth_info).to eq(existing_pw)
end
it 'does not assign invalid status to domain' do