mirror of
https://github.com/internetee/registry.git
synced 2025-07-20 09:46:09 +02:00
Merge pull request #1911 from internetee/1899-add-email-to-fd-notes
Add invalid email to FD status note on auto-FD
This commit is contained in:
commit
4f4fd70573
3 changed files with 10 additions and 0 deletions
|
@ -5,6 +5,7 @@ module Domains
|
|||
domain.force_delete_data = nil
|
||||
domain.force_delete_date = nil
|
||||
domain.force_delete_start = nil
|
||||
domain.status_notes[DomainStatus::FORCE_DELETE] = nil
|
||||
domain.save(validate: false)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -21,6 +21,12 @@ module Domains
|
|||
notify_by_email: true,
|
||||
reason: 'invalid_email',
|
||||
email: email)
|
||||
save_status_note(domain)
|
||||
end
|
||||
|
||||
def save_status_note(domain)
|
||||
domain.status_notes[DomainStatus::FORCE_DELETE] = email
|
||||
domain.save(validate: false)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -403,6 +403,7 @@ class ForceDeleteTest < ActionMailer::TestCase
|
|||
assert_equal 'invalid_email', @domain.template_name
|
||||
assert_equal Date.parse('2010-09-19'), @domain.force_delete_date.to_date
|
||||
assert_equal Date.parse('2010-08-05'), @domain.force_delete_start.to_date
|
||||
assert_equal @domain.status_notes[DomainStatus::FORCE_DELETE], email
|
||||
notification = @domain.registrar.notifications.last
|
||||
assert notification.text.include? asserted_text
|
||||
end
|
||||
|
@ -432,7 +433,9 @@ class ForceDeleteTest < ActionMailer::TestCase
|
|||
|
||||
@domain.reload
|
||||
assert_not @domain.force_delete_scheduled?
|
||||
assert_nil @domain.status_notes[DomainStatus::FORCE_DELETE]
|
||||
end
|
||||
|
||||
def test_lifts_force_delete_after_bounce_changes
|
||||
@domain.update(valid_to: Time.zone.parse('2012-08-05'))
|
||||
assert_not @domain.force_delete_scheduled?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue