mirror of
https://github.com/internetee/registry.git
synced 2025-07-20 17:55:55 +02:00
Specs
This commit is contained in:
parent
d2c31021a9
commit
360c2d3db8
8 changed files with 98 additions and 13 deletions
|
@ -2,7 +2,7 @@ module Epp::ContactsHelper
|
|||
def create_contact
|
||||
@contact = Contact.new(contact_and_address_attributes)
|
||||
@contact.registrar = current_epp_user.registrar
|
||||
render '/epp/contacts/create' and return if stamp(@contact) && @contact.save
|
||||
render_epp_response '/epp/contacts/create' and return if stamp(@contact) && @contact.save
|
||||
handle_errors(@contact)
|
||||
end
|
||||
|
||||
|
@ -12,7 +12,7 @@ module Epp::ContactsHelper
|
|||
@contact = Contact.where(code: code).first
|
||||
# if update_rights? && stamp(@contact) && @contact.update_attributes(contact_and_address_attributes(:update))
|
||||
if owner? && stamp(@contact) && @contact.update_attributes(contact_and_address_attributes(:update))
|
||||
render 'epp/contacts/update'
|
||||
render_epp_response 'epp/contacts/update'
|
||||
else
|
||||
contact_exists?(code)
|
||||
handle_errors(@contact) and return
|
||||
|
@ -26,14 +26,14 @@ module Epp::ContactsHelper
|
|||
handle_errors(@contact) and return unless @contact
|
||||
handle_errors(@contact) and return unless @contact.destroy_and_clean
|
||||
|
||||
render '/epp/contacts/delete'
|
||||
render_epp_response '/epp/contacts/delete'
|
||||
end
|
||||
# rubocop:enable Metrics/CyclomaticComplexity
|
||||
|
||||
def check_contact
|
||||
ph = params_hash['epp']['command']['check']['check']
|
||||
@contacts = Contact.check_availability(ph[:id])
|
||||
render '/epp/contacts/check'
|
||||
render_epp_response '/epp/contacts/check'
|
||||
end
|
||||
|
||||
def info_contact
|
||||
|
@ -42,7 +42,7 @@ module Epp::ContactsHelper
|
|||
@disclosure = ContactDisclosure.default_values.merge(@contact.disclosure.try(:as_hash) || {})
|
||||
@disclosure_policy = @contact.disclosure.try(:attributes_with_flag)
|
||||
@owner = owner?(false)
|
||||
render 'epp/contacts/info'
|
||||
render_epp_response 'epp/contacts/info'
|
||||
end
|
||||
|
||||
def renew_contact
|
||||
|
|
|
@ -10,7 +10,7 @@ module Epp::KeyrelayHelper
|
|||
handle_errors(@domain) and return unless @domain.authenticate(parsed_frame.css('pw').text)
|
||||
handle_errors(@domain) and return unless @domain.keyrelay(parsed_frame, current_epp_user.registrar)
|
||||
|
||||
render '/epp/shared/success'
|
||||
render_epp_response '/epp/shared/success'
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
@ -6,18 +6,16 @@ module Epp::PollHelper
|
|||
|
||||
def req_poll
|
||||
@message = current_epp_user.queued_messages.last
|
||||
render 'epp/poll/poll_no_messages' and return unless @message
|
||||
render_epp_response 'epp/poll/poll_no_messages' and return unless @message
|
||||
|
||||
if @message.attached_obj_type && @message.attached_obj_id
|
||||
@object = Object.const_get(@message.attached_obj_type).find(@message.attached_obj_id)
|
||||
end
|
||||
|
||||
if @message.attached_obj_type == 'Keyrelay'
|
||||
@response = render_to_string('epp/poll/poll_keyrelay')
|
||||
render xml: @response
|
||||
# render 'epp/poll/poll_keyrelay'
|
||||
render_epp_response 'epp/poll/poll_keyrelay'
|
||||
else
|
||||
render 'epp/poll/poll_req'
|
||||
render_epp_response 'epp/poll/poll_req'
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -34,7 +32,7 @@ module Epp::PollHelper
|
|||
end
|
||||
|
||||
handle_errors(@message) and return unless @message.dequeue
|
||||
render 'epp/poll/poll_ack'
|
||||
render_epp_response 'epp/poll/poll_ack'
|
||||
end
|
||||
|
||||
private
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue