mirror of
https://github.com/internetee/registry.git
synced 2025-07-10 05:03:38 +02:00
Contact#update tests to check disclosure update
This commit is contained in:
parent
0e655bf306
commit
a9df2c82b1
2 changed files with 13 additions and 2 deletions
|
@ -7,12 +7,13 @@ module Epp::ContactsHelper
|
|||
end
|
||||
|
||||
def update_contact
|
||||
# FIXME: Update returns 2303 update multiple times
|
||||
code = params_hash['epp']['command']['update']['update'][:id]
|
||||
@contact = Contact.where(code: code).first
|
||||
if rights? && stamp(@contact) && @contact.update_attributes(contact_and_address_attributes(:update))
|
||||
render 'epp/contacts/update'
|
||||
else
|
||||
contact_exists?
|
||||
contact_exists?(code)
|
||||
handle_errors(@contact)
|
||||
end
|
||||
end
|
||||
|
@ -67,7 +68,7 @@ module Epp::ContactsHelper
|
|||
xml_attrs_present?(@ph, [['id']])
|
||||
end
|
||||
|
||||
def contact_exists?
|
||||
def contact_exists?(code)
|
||||
return true if @contact.is_a?(Contact)
|
||||
epp_errors << { code: '2303', msg: t('errors.messages.epp_obj_does_not_exist'),
|
||||
value: { obj: 'id', val: code } }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue