mirror of
https://github.com/internetee/registry.git
synced 2025-06-12 15:44:45 +02:00
Add tests & fixes for epp contact
This commit is contained in:
parent
860c3c8008
commit
7163695ad1
10 changed files with 84 additions and 29 deletions
24
app/models/concerns/roids.rb
Normal file
24
app/models/concerns/roids.rb
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
module Roids
|
||||||
|
extend ActiveSupport::Concern
|
||||||
|
ID_CHAR_LIMIT = 8
|
||||||
|
|
||||||
|
included do
|
||||||
|
def roid
|
||||||
|
id_size = id.to_s.size
|
||||||
|
if id_size <= ID_CHAR_LIMIT
|
||||||
|
"EIS-#{id}"
|
||||||
|
else
|
||||||
|
roid_with_prefix(id_size)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def roid_with_prefix(id_size)
|
||||||
|
id_delta = id_size - ID_CHAR_LIMIT
|
||||||
|
id_prefix = id.to_s.split(//).first(id_delta).join('').to_s
|
||||||
|
id_postfix = id.to_s.split(//).last(id_size - id_delta).join('').to_s
|
||||||
|
"EIS#{id_prefix}-#{id_postfix}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -21,7 +21,7 @@ module UserEvents
|
||||||
Registrar.find(cr_registrar_id).code
|
Registrar.find(cr_registrar_id).code
|
||||||
else
|
else
|
||||||
# cr_id optional for domain, but required for contact; but we want something here anyway
|
# cr_id optional for domain, but required for contact; but we want something here anyway
|
||||||
self.creator_str # Fallback if we failed, maybe we can find a string here
|
self.creator_str || self.registrar.code # Fallback
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,6 +2,7 @@ require 'deserializers/xml/legal_document'
|
||||||
|
|
||||||
class Contact < ApplicationRecord
|
class Contact < ApplicationRecord
|
||||||
include Versions # version/contact_version.rb
|
include Versions # version/contact_version.rb
|
||||||
|
include Roids
|
||||||
include EppErrors
|
include EppErrors
|
||||||
include UserEvents
|
include UserEvents
|
||||||
include Contact::Transferable
|
include Contact::Transferable
|
||||||
|
@ -259,10 +260,6 @@ class Contact < ApplicationRecord
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def roid
|
|
||||||
"EIS-#{id}"
|
|
||||||
end
|
|
||||||
|
|
||||||
# kind of decorator in order to always return statuses
|
# kind of decorator in order to always return statuses
|
||||||
# if we use separate decorator, then we should add it
|
# if we use separate decorator, then we should add it
|
||||||
# to too many places
|
# to too many places
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
class Domain < ApplicationRecord
|
class Domain < ApplicationRecord
|
||||||
include UserEvents
|
include UserEvents
|
||||||
|
include Roids
|
||||||
include Versions # version/domain_version.rb
|
include Versions # version/domain_version.rb
|
||||||
include Domain::Expirable
|
include Domain::Expirable
|
||||||
include Domain::Activatable
|
include Domain::Activatable
|
||||||
|
@ -33,8 +34,6 @@ class Domain < ApplicationRecord
|
||||||
has_many :tech_domain_contacts
|
has_many :tech_domain_contacts
|
||||||
accepts_nested_attributes_for :tech_domain_contacts, allow_destroy: true, reject_if: :tech_change_prohibited?
|
accepts_nested_attributes_for :tech_domain_contacts, allow_destroy: true, reject_if: :tech_change_prohibited?
|
||||||
|
|
||||||
ID_CHAR_LIMIT = 8
|
|
||||||
|
|
||||||
def registrant_change_prohibited?
|
def registrant_change_prohibited?
|
||||||
statuses.include? DomainStatus::SERVER_REGISTRANT_CHANGE_PROHIBITED
|
statuses.include? DomainStatus::SERVER_REGISTRANT_CHANGE_PROHIBITED
|
||||||
end
|
end
|
||||||
|
@ -332,15 +331,6 @@ class Domain < ApplicationRecord
|
||||||
domain
|
domain
|
||||||
end
|
end
|
||||||
|
|
||||||
def roid
|
|
||||||
id_size = id.to_s.size
|
|
||||||
if id_size <= ID_CHAR_LIMIT
|
|
||||||
"EIS-#{id}"
|
|
||||||
else
|
|
||||||
roid_with_prefix(id_size)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def puny_label
|
def puny_label
|
||||||
name_puny.to_s.split('.').first
|
name_puny.to_s.split('.').first
|
||||||
end
|
end
|
||||||
|
@ -741,13 +731,4 @@ class Domain < ApplicationRecord
|
||||||
def self.uses_zone?(zone)
|
def self.uses_zone?(zone)
|
||||||
exists?(["name ILIKE ?", "%.#{zone.origin}"])
|
exists?(["name ILIKE ?", "%.#{zone.origin}"])
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def roid_with_prefix(id_size)
|
|
||||||
id_delta = id_size - ID_CHAR_LIMIT
|
|
||||||
id_prefix = id.to_s.split(//).first(id_delta).join('').to_s
|
|
||||||
id_postfix = id.to_s.split(//).last(id_size - id_delta).join('').to_s
|
|
||||||
"EIS#{id_prefix}-#{id_postfix}"
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -25,6 +25,7 @@ class EppContactCheckBaseTest < EppTestCase
|
||||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||||
|
|
||||||
response_xml = Nokogiri::XML(response.body)
|
response_xml = Nokogiri::XML(response.body)
|
||||||
|
assert_correct_against_schema response_xml
|
||||||
assert_epp_response :completed_successfully
|
assert_epp_response :completed_successfully
|
||||||
assert_equal "#{@contact.registrar.code}:JOHN-001".upcase, response_xml.at_xpath('//contact:id', contact: xml_schema).text
|
assert_equal "#{@contact.registrar.code}:JOHN-001".upcase, response_xml.at_xpath('//contact:id', contact: xml_schema).text
|
||||||
end
|
end
|
||||||
|
@ -47,6 +48,7 @@ class EppContactCheckBaseTest < EppTestCase
|
||||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||||
|
|
||||||
response_xml = Nokogiri::XML(response.body)
|
response_xml = Nokogiri::XML(response.body)
|
||||||
|
assert_correct_against_schema response_xml
|
||||||
assert_equal '1', response_xml.at_xpath('//contact:id', contact: xml_schema)['avail']
|
assert_equal '1', response_xml.at_xpath('//contact:id', contact: xml_schema)['avail']
|
||||||
assert_nil response_xml.at_xpath('//contact:reason', contact: xml_schema)
|
assert_nil response_xml.at_xpath('//contact:reason', contact: xml_schema)
|
||||||
end
|
end
|
||||||
|
@ -72,6 +74,7 @@ class EppContactCheckBaseTest < EppTestCase
|
||||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||||
|
|
||||||
response_xml = Nokogiri::XML(response.body)
|
response_xml = Nokogiri::XML(response.body)
|
||||||
|
assert_correct_against_schema response_xml
|
||||||
assert_equal '0', response_xml.at_xpath('//contact:id', contact: xml_schema)['avail']
|
assert_equal '0', response_xml.at_xpath('//contact:id', contact: xml_schema)['avail']
|
||||||
assert_equal 'in use', response_xml.at_xpath('//contact:reason', contact: xml_schema).text
|
assert_equal 'in use', response_xml.at_xpath('//contact:reason', contact: xml_schema).text
|
||||||
end
|
end
|
||||||
|
@ -96,6 +99,7 @@ class EppContactCheckBaseTest < EppTestCase
|
||||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||||
|
|
||||||
response_xml = Nokogiri::XML(response.body)
|
response_xml = Nokogiri::XML(response.body)
|
||||||
|
assert_correct_against_schema response_xml
|
||||||
assert_equal 3, response_xml.xpath('//contact:cd', contact: xml_schema).size
|
assert_equal 3, response_xml.xpath('//contact:cd', contact: xml_schema).size
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -120,6 +124,7 @@ class EppContactCheckBaseTest < EppTestCase
|
||||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||||
|
|
||||||
response_xml = Nokogiri::XML(response.body)
|
response_xml = Nokogiri::XML(response.body)
|
||||||
|
assert_correct_against_schema response_xml
|
||||||
assert_epp_response :completed_successfully
|
assert_epp_response :completed_successfully
|
||||||
assert_equal "#{@contact.registrar.code}:JOHN-001".upcase, response_xml.at_xpath('//contact:id', contact: xml_schema).text
|
assert_equal "#{@contact.registrar.code}:JOHN-001".upcase, response_xml.at_xpath('//contact:id', contact: xml_schema).text
|
||||||
assert_equal 'in use', response_xml.at_xpath('//contact:reason', contact: xml_schema).text
|
assert_equal 'in use', response_xml.at_xpath('//contact:reason', contact: xml_schema).text
|
||||||
|
@ -146,6 +151,7 @@ class EppContactCheckBaseTest < EppTestCase
|
||||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||||
|
|
||||||
response_xml = Nokogiri::XML(response.body)
|
response_xml = Nokogiri::XML(response.body)
|
||||||
|
assert_correct_against_schema response_xml
|
||||||
assert_epp_response :completed_successfully
|
assert_epp_response :completed_successfully
|
||||||
assert_equal "#{@contact.registrar.code}:JOHN-001".upcase, response_xml.at_xpath('//contact:id', contact: xml_schema).text
|
assert_equal "#{@contact.registrar.code}:JOHN-001".upcase, response_xml.at_xpath('//contact:id', contact: xml_schema).text
|
||||||
assert_equal 'in use', response_xml.at_xpath('//contact:reason', contact: xml_schema).text
|
assert_equal 'in use', response_xml.at_xpath('//contact:reason', contact: xml_schema).text
|
||||||
|
|
|
@ -33,6 +33,8 @@ class EppContactCreateBaseTest < EppTestCase
|
||||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
response_xml = Nokogiri::XML(response.body)
|
||||||
|
assert_correct_against_schema response_xml
|
||||||
assert_epp_response :completed_successfully
|
assert_epp_response :completed_successfully
|
||||||
contact = Contact.find_by(name: name)
|
contact = Contact.find_by(name: name)
|
||||||
assert_equal name, contact.name
|
assert_equal name, contact.name
|
||||||
|
@ -74,6 +76,8 @@ class EppContactCreateBaseTest < EppTestCase
|
||||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
response_xml = Nokogiri::XML(response.body)
|
||||||
|
assert_correct_against_schema response_xml
|
||||||
assert_epp_response :parameter_value_syntax_error
|
assert_epp_response :parameter_value_syntax_error
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -109,6 +113,8 @@ class EppContactCreateBaseTest < EppTestCase
|
||||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
response_xml = Nokogiri::XML(response.body)
|
||||||
|
assert_correct_against_schema response_xml
|
||||||
assert_epp_response :parameter_value_syntax_error
|
assert_epp_response :parameter_value_syntax_error
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -143,6 +149,8 @@ class EppContactCreateBaseTest < EppTestCase
|
||||||
post epp_create_path, params: { frame: request_xml },
|
post epp_create_path, params: { frame: request_xml },
|
||||||
headers: { 'HTTP_COOKIE' => "session=#{session.session_id}" }
|
headers: { 'HTTP_COOKIE' => "session=#{session.session_id}" }
|
||||||
|
|
||||||
|
response_xml = Nokogiri::XML(response.body)
|
||||||
|
assert_correct_against_schema response_xml
|
||||||
contact = Contact.find_by(name: name)
|
contact = Contact.find_by(name: name)
|
||||||
assert_equal "#{session.user.registrar.code}:#{code}".upcase, contact.code
|
assert_equal "#{session.user.registrar.code}:#{code}".upcase, contact.code
|
||||||
end
|
end
|
||||||
|
@ -174,6 +182,8 @@ class EppContactCreateBaseTest < EppTestCase
|
||||||
post epp_create_path, params: { frame: request_xml },
|
post epp_create_path, params: { frame: request_xml },
|
||||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||||
end
|
end
|
||||||
|
response_xml = Nokogiri::XML(response.body)
|
||||||
|
assert_correct_against_schema response_xml
|
||||||
assert_epp_response :required_parameter_missing
|
assert_epp_response :required_parameter_missing
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -216,6 +226,8 @@ class EppContactCreateBaseTest < EppTestCase
|
||||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
response_xml = Nokogiri::XML(response.body)
|
||||||
|
assert_correct_against_schema response_xml
|
||||||
assert_epp_response :completed_without_address
|
assert_epp_response :completed_without_address
|
||||||
contact = Contact.find_by(name: name)
|
contact = Contact.find_by(name: name)
|
||||||
assert_equal name, contact.name
|
assert_equal name, contact.name
|
||||||
|
@ -275,6 +287,8 @@ class EppContactCreateBaseTest < EppTestCase
|
||||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
response_xml = Nokogiri::XML(response.body)
|
||||||
|
assert_correct_against_schema response_xml
|
||||||
assert_epp_response :completed_successfully
|
assert_epp_response :completed_successfully
|
||||||
contact = Contact.find_by(name: name)
|
contact = Contact.find_by(name: name)
|
||||||
assert_equal name, contact.name
|
assert_equal name, contact.name
|
||||||
|
|
|
@ -24,6 +24,9 @@ class EppContactDeleteBaseTest < EppTestCase
|
||||||
post epp_delete_path, params: { frame: request_xml },
|
post epp_delete_path, params: { frame: request_xml },
|
||||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
response_xml = Nokogiri::XML(response.body)
|
||||||
|
assert_correct_against_schema response_xml
|
||||||
assert_epp_response :completed_successfully
|
assert_epp_response :completed_successfully
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -50,6 +53,8 @@ class EppContactDeleteBaseTest < EppTestCase
|
||||||
post epp_delete_path, params: { frame: request_xml },
|
post epp_delete_path, params: { frame: request_xml },
|
||||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||||
|
|
||||||
|
response_xml = Nokogiri::XML(response.body)
|
||||||
|
assert_correct_against_schema response_xml
|
||||||
assert Contact.exists?(id: contact.id)
|
assert Contact.exists?(id: contact.id)
|
||||||
assert_epp_response :object_status_prohibits_operation
|
assert_epp_response :object_status_prohibits_operation
|
||||||
end
|
end
|
||||||
|
@ -77,6 +82,8 @@ class EppContactDeleteBaseTest < EppTestCase
|
||||||
post epp_delete_path, params: { frame: request_xml },
|
post epp_delete_path, params: { frame: request_xml },
|
||||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||||
|
|
||||||
|
response_xml = Nokogiri::XML(response.body)
|
||||||
|
assert_correct_against_schema response_xml
|
||||||
assert Contact.exists?(id: contact.id)
|
assert Contact.exists?(id: contact.id)
|
||||||
assert_epp_response :object_status_prohibits_operation
|
assert_epp_response :object_status_prohibits_operation
|
||||||
end
|
end
|
||||||
|
@ -105,6 +112,8 @@ class EppContactDeleteBaseTest < EppTestCase
|
||||||
post epp_delete_path, params: { frame: request_xml },
|
post epp_delete_path, params: { frame: request_xml },
|
||||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||||
end
|
end
|
||||||
|
response_xml = Nokogiri::XML(response.body)
|
||||||
|
assert_correct_against_schema response_xml
|
||||||
assert_epp_response :object_association_prohibits_operation
|
assert_epp_response :object_association_prohibits_operation
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@ class EppContactInfoBaseTest < EppTestCase
|
||||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||||
|
|
||||||
response_xml = Nokogiri::XML(response.body)
|
response_xml = Nokogiri::XML(response.body)
|
||||||
|
assert_correct_against_schema response_xml
|
||||||
assert_epp_response :completed_successfully
|
assert_epp_response :completed_successfully
|
||||||
assert_equal 'JOHN-001', response_xml.at_xpath('//contact:id', contact: xml_schema).text
|
assert_equal 'JOHN-001', response_xml.at_xpath('//contact:id', contact: xml_schema).text
|
||||||
assert_equal 'ok', response_xml.at_xpath('//contact:status', contact: xml_schema)['s']
|
assert_equal 'ok', response_xml.at_xpath('//contact:status', contact: xml_schema)['s']
|
||||||
|
@ -65,6 +66,7 @@ class EppContactInfoBaseTest < EppTestCase
|
||||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||||
|
|
||||||
response_xml = Nokogiri::XML(response.body)
|
response_xml = Nokogiri::XML(response.body)
|
||||||
|
assert_correct_against_schema response_xml
|
||||||
assert_epp_response :completed_successfully
|
assert_epp_response :completed_successfully
|
||||||
assert_equal 'TEST:JOHN-001', response_xml.at_xpath('//contact:id', contact: xml_schema).text
|
assert_equal 'TEST:JOHN-001', response_xml.at_xpath('//contact:id', contact: xml_schema).text
|
||||||
assert_equal '+555.555', response_xml.at_xpath('//contact:voice', contact: xml_schema).text
|
assert_equal '+555.555', response_xml.at_xpath('//contact:voice', contact: xml_schema).text
|
||||||
|
@ -91,6 +93,7 @@ class EppContactInfoBaseTest < EppTestCase
|
||||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||||
|
|
||||||
response_xml = Nokogiri::XML(response.body)
|
response_xml = Nokogiri::XML(response.body)
|
||||||
|
assert_correct_against_schema response_xml
|
||||||
assert_epp_response :completed_successfully
|
assert_epp_response :completed_successfully
|
||||||
assert_equal "#{@contact.registrar.code}:JOHN-001".upcase, response_xml.at_xpath('//contact:id', contact: xml_schema).text
|
assert_equal "#{@contact.registrar.code}:JOHN-001".upcase, response_xml.at_xpath('//contact:id', contact: xml_schema).text
|
||||||
assert_equal '+555.555', response_xml.at_xpath('//contact:voice', contact: xml_schema).text
|
assert_equal '+555.555', response_xml.at_xpath('//contact:voice', contact: xml_schema).text
|
||||||
|
@ -121,6 +124,7 @@ class EppContactInfoBaseTest < EppTestCase
|
||||||
|
|
||||||
assert_epp_response :completed_successfully
|
assert_epp_response :completed_successfully
|
||||||
response_xml = Nokogiri::XML(response.body)
|
response_xml = Nokogiri::XML(response.body)
|
||||||
|
assert_correct_against_schema response_xml
|
||||||
assert_nil response_xml.at_xpath('//contact:authInfo', contact: xml_schema)
|
assert_nil response_xml.at_xpath('//contact:authInfo', contact: xml_schema)
|
||||||
assert_equal 'No access', response_xml.at_xpath('//contact:name', contact: xml_schema).text
|
assert_equal 'No access', response_xml.at_xpath('//contact:name', contact: xml_schema).text
|
||||||
end
|
end
|
||||||
|
|
|
@ -19,6 +19,8 @@ class EppContactTransferBaseTest < EppTestCase
|
||||||
post epp_transfer_path, params: { frame: request_xml },
|
post epp_transfer_path, params: { frame: request_xml },
|
||||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||||
|
|
||||||
|
response_xml = Nokogiri::XML(response.body)
|
||||||
|
assert_correct_against_schema response_xml
|
||||||
assert_epp_response :unimplemented
|
assert_epp_response :unimplemented
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -41,6 +41,8 @@ class EppContactUpdateBaseTest < EppTestCase
|
||||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||||
@contact.reload
|
@contact.reload
|
||||||
|
|
||||||
|
response_xml = Nokogiri::XML(response.body)
|
||||||
|
assert_correct_against_schema response_xml
|
||||||
assert_epp_response :completed_successfully
|
assert_epp_response :completed_successfully
|
||||||
assert_equal 'new name', @contact.name
|
assert_equal 'new name', @contact.name
|
||||||
assert_equal 'new-email@inbox.test', @contact.email
|
assert_equal 'new-email@inbox.test', @contact.email
|
||||||
|
@ -73,6 +75,8 @@ class EppContactUpdateBaseTest < EppTestCase
|
||||||
post epp_update_path, params: { frame: request_xml },
|
post epp_update_path, params: { frame: request_xml },
|
||||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||||
|
|
||||||
|
response_xml = Nokogiri::XML(response.body)
|
||||||
|
assert_correct_against_schema response_xml
|
||||||
assert_emails 1
|
assert_emails 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -101,7 +105,8 @@ class EppContactUpdateBaseTest < EppTestCase
|
||||||
|
|
||||||
post epp_update_path, params: { frame: request_xml },
|
post epp_update_path, params: { frame: request_xml },
|
||||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||||
|
response_xml = Nokogiri::XML(response.body)
|
||||||
|
assert_correct_against_schema response_xml
|
||||||
assert_no_emails
|
assert_no_emails
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -133,7 +138,8 @@ class EppContactUpdateBaseTest < EppTestCase
|
||||||
|
|
||||||
post epp_update_path, params: { frame: request_xml },
|
post epp_update_path, params: { frame: request_xml },
|
||||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||||
|
response_xml = Nokogiri::XML(response.body)
|
||||||
|
assert_correct_against_schema response_xml
|
||||||
assert_no_emails
|
assert_no_emails
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -160,7 +166,8 @@ class EppContactUpdateBaseTest < EppTestCase
|
||||||
|
|
||||||
post epp_update_path, params: { frame: request_xml },
|
post epp_update_path, params: { frame: request_xml },
|
||||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||||
|
response_xml = Nokogiri::XML(response.body)
|
||||||
|
assert_correct_against_schema response_xml
|
||||||
assert_epp_response :object_does_not_exist
|
assert_epp_response :object_does_not_exist
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -196,6 +203,8 @@ class EppContactUpdateBaseTest < EppTestCase
|
||||||
post epp_update_path, params: { frame: request_xml },
|
post epp_update_path, params: { frame: request_xml },
|
||||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||||
end
|
end
|
||||||
|
response_xml = Nokogiri::XML(response.body)
|
||||||
|
assert_correct_against_schema response_xml
|
||||||
assert_epp_response :data_management_policy_violation
|
assert_epp_response :data_management_policy_violation
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -228,7 +237,8 @@ class EppContactUpdateBaseTest < EppTestCase
|
||||||
XML
|
XML
|
||||||
post epp_update_path, params: { frame: request_xml },
|
post epp_update_path, params: { frame: request_xml },
|
||||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||||
|
response_xml = Nokogiri::XML(response.body)
|
||||||
|
assert_correct_against_schema response_xml
|
||||||
assert_epp_response :completed_successfully
|
assert_epp_response :completed_successfully
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -269,6 +279,8 @@ class EppContactUpdateBaseTest < EppTestCase
|
||||||
post epp_update_path, params: { frame: request_xml },
|
post epp_update_path, params: { frame: request_xml },
|
||||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||||
|
|
||||||
|
response_xml = Nokogiri::XML(response.body)
|
||||||
|
assert_correct_against_schema response_xml
|
||||||
assert_epp_response :completed_successfully
|
assert_epp_response :completed_successfully
|
||||||
@contact.reload
|
@contact.reload
|
||||||
|
|
||||||
|
@ -315,6 +327,8 @@ class EppContactUpdateBaseTest < EppTestCase
|
||||||
post epp_update_path, params: { frame: request_xml },
|
post epp_update_path, params: { frame: request_xml },
|
||||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||||
|
|
||||||
|
response_xml = Nokogiri::XML(response.body)
|
||||||
|
assert_correct_against_schema response_xml
|
||||||
assert_epp_response :completed_without_address
|
assert_epp_response :completed_without_address
|
||||||
@contact.reload
|
@contact.reload
|
||||||
|
|
||||||
|
@ -362,6 +376,8 @@ class EppContactUpdateBaseTest < EppTestCase
|
||||||
post epp_update_path, params: { frame: request_xml },
|
post epp_update_path, params: { frame: request_xml },
|
||||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||||
|
|
||||||
|
response_xml = Nokogiri::XML(response.body)
|
||||||
|
assert_correct_against_schema response_xml
|
||||||
@contact.reload
|
@contact.reload
|
||||||
|
|
||||||
assert_not_equal city, @contact.city
|
assert_not_equal city, @contact.city
|
||||||
|
@ -417,6 +433,8 @@ class EppContactUpdateBaseTest < EppTestCase
|
||||||
@contact.reload
|
@contact.reload
|
||||||
end
|
end
|
||||||
|
|
||||||
|
response_xml = Nokogiri::XML(response.body)
|
||||||
|
assert_correct_against_schema response_xml
|
||||||
assert_epp_response :completed_successfully
|
assert_epp_response :completed_successfully
|
||||||
assert_equal 'new name', @contact.name
|
assert_equal 'new name', @contact.name
|
||||||
assert_equal 'new-email@inbox.test', @contact.email
|
assert_equal 'new-email@inbox.test', @contact.email
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue