Merge branch 'master' into 2080-implement-new-field-for-store-statuses-in-domain-model

This commit is contained in:
Alex Sherman 2021-07-14 14:51:58 +05:00 committed by Oleg Hasjanov
commit d047561bdc
6 changed files with 81 additions and 6 deletions

View file

@ -1,3 +1,8 @@
08.07.2021
* improved contact name validation [#1795](https://github.com/internetee/registry/issues/1795)
* orphaned poll messages are automatically dequed [#2026](https://github.com/internetee/registry/issues/2026)
* fixed registrant change with force delete set [#2077](https://github.com/internetee/registry/issues/2077)
06.07.2021
* admin dropdown filter ui fix [#2065](https://github.com/internetee/registry/issues/2065)
* Bump truemail to 2.4.4 [#2071](https://github.com/internetee/registry/pull/2071)

View file

@ -115,7 +115,7 @@ GEM
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
active_interaction (4.0.4)
active_interaction (4.0.5)
activemodel (>= 5, < 7)
activesupport (>= 5, < 7)
activejob (6.1.4)
@ -139,7 +139,7 @@ GEM
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.7.0)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
aes_key_wrap (1.1.0)
airbrake (11.0.3)
@ -205,7 +205,7 @@ GEM
daemons-rails (1.2.1)
daemons
multi_json (~> 1.0)
data_migrate (7.0.1)
data_migrate (7.0.2)
activerecord (>= 5.0)
railties (>= 5.0)
database_cleaner (2.0.1)
@ -387,7 +387,7 @@ GEM
method_source
rake (>= 0.13)
thor (~> 1.0)
rake (13.0.3)
rake (13.0.6)
ransack (2.4.2)
activerecord (>= 5.2.4)
activesupport (>= 5.2.4)
@ -463,7 +463,7 @@ GEM
temple (0.8.2)
thor (1.1.0)
tilt (2.0.10)
truemail (2.4.4)
truemail (2.4.6)
simpleidn (~> 0.2.1)
tzinfo (2.0.4)
concurrent-ruby (~> 1.0)

View file

@ -27,6 +27,7 @@ module Epp
Rails.logger.error 'orphan message, error ignored: ' + problem.to_s
# now we should dequeue or delete the messages avoid duplicate log alarms
@notification.mark_as_read
end
end

View file

@ -14,7 +14,7 @@
- opts = [[t(:choose),''], 'contact', 'domain', 'poll']
- opts += [params[:q][:request_object_cont]] if params[:q].present? && params[:q][:request_object_cont].present?
= f.label :request_object
= f.select :request_object_cont, opts, {}, class: 'form-control js-combobox', placeholder: t(:choose)
= f.select :request_object_cont, opts, {}, class: 'form-control selectize_create', placeholder: t(:choose)
.col-md-3
.form-group
= f.label :request_successful

View file

@ -588,6 +588,50 @@ class EppDomainUpdateBaseTest < EppTestCase
assert_no_emails
end
def test_makes_update_if_was_forcedelete
contact = @domain.contacts.first
contact.update_attribute(:email, '`@outlook.test')
contact.email_verification.verify
assert contact.email_verification_failed?
@domain.reload
assert @domain.force_delete_scheduled?
@domain.update_attribute(:statuses_before_force_delete, nil)
Setting.request_confirmation_on_registrant_change_enabled = true
new_registrant = contacts(:william).becomes(Registrant)
assert_not_equal new_registrant, @domain.registrant
request_xml = <<-XML
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee', for_version: '1.0')}">
<command>
<update>
<domain:update xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}">
<domain:name>#{@domain.name}</domain:name>
<domain:chg>
<domain:registrant verified="yes">#{new_registrant.code}</domain:registrant>
</domain:chg>
</domain:update>
</update>
<extension>
<eis:extdata xmlns:eis="#{Xsd::Schema.filename(for_prefix: 'eis', for_version: '1.0')}">
<eis:legalDocument type="pdf">#{'test' * 2000}</eis:legalDocument>
</eis:extdata>
</extension>
</command>
</epp>
XML
post epp_update_path, params: { frame: request_xml },
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
@domain.reload
response_xml = Nokogiri::XML(response.body)
assert_correct_against_schema response_xml
assert_epp_response :completed_successfully
end
def test_clears_force_delete_when_registrar_changed
Setting.request_confirmation_on_registrant_change_enabled = true
new_registrant = contacts(:william).becomes(Registrant)

View file

@ -26,6 +26,31 @@ class EppPollTest < EppTestCase
assert_equal 'Your domain has been updated', xml_doc.at_css('msgQ msg').text
end
def test_clears_orphan_messages_if_any
# To check if we are clearing orphan messages we need to create a message not linked to any
# existing Epp::Domain
orphan_notification = @notification.dup
orphan_notification.attached_obj_type = Epp::Domain
orphan_notification.attached_obj_id = rand(Epp::Domain.first.id-1)
orphan_notification.save!
assert orphan_notification.unread?
request_xml = <<-XML
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee', for_version: '1.0')}">
<command>
<poll op="req"/>
</command>
</epp>
XML
post epp_poll_path, params: { frame: request_xml },
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
orphan_notification.reload
refute orphan_notification.unread?
end
def test_does_not_drop_error_if_old_version
version = Version::DomainVersion.last
@notification.update(attached_obj_type: 'DomainVersion', attached_obj_id: version.id)