mirror of
https://github.com/internetee/registry.git
synced 2025-06-08 13:44:47 +02:00
Merge pull request #1197 from internetee/fix-domain-delete-procedure
Notify registrar about domain deletion when auction feature is on
This commit is contained in:
commit
c018ec84a2
2 changed files with 12 additions and 0 deletions
|
@ -42,6 +42,9 @@ module Concerns
|
|||
transaction do
|
||||
domain_name.sell_at_auction if domain_name.auctionable?
|
||||
destroy!
|
||||
registrar.notifications.create!(text: "#{I18n.t(:domain_deleted)}: #{name}",
|
||||
attached_obj_id: id,
|
||||
attached_obj_type: self.class)
|
||||
end
|
||||
else
|
||||
discard
|
||||
|
|
|
@ -58,6 +58,15 @@ class DomainReleasableAuctionableTest < ActiveSupport::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
def test_notifies_registrar
|
||||
@domain.update!(delete_date: '2010-07-04')
|
||||
travel_to Time.zone.parse('2010-07-05')
|
||||
|
||||
assert_difference -> { @domain.registrar.notifications.count } do
|
||||
Domain.release_domains
|
||||
end
|
||||
end
|
||||
|
||||
def test_ignores_domains_with_delete_date_in_the_future
|
||||
@domain.update!(delete_date: '2010-07-06')
|
||||
travel_to Time.zone.parse('2010-07-05')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue