mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 08:22:05 +02:00
Add interactor tests
This commit is contained in:
parent
d406334926
commit
4c7f9f2026
4 changed files with 28 additions and 13 deletions
|
@ -1,11 +1,11 @@
|
|||
module DomainDeleteInteraction
|
||||
class Delete < :Base
|
||||
class Delete < Base
|
||||
def execute
|
||||
::PaperTrail.request.whodunnit = "interaction - #{self.class.name}"
|
||||
WhoisRecord.where(domain_id: domain.id).destroy_all
|
||||
|
||||
domain.destroy
|
||||
compose(NotifyRegistrar, inputs)
|
||||
compose(DomainDeleteInteraction::NotifyRegistrar, inputs)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
module DomainDeleteInteraction
|
||||
class NotifyRegistrar < Delete
|
||||
class NotifyRegistrar < Base
|
||||
def execute
|
||||
bye_bye = domain.versions.last
|
||||
domain.registrar.notifications.create!(
|
|
@ -4,15 +4,5 @@ class DomainDeleteJob < Que::Job
|
|||
domain = Domain.find(domain_id)
|
||||
|
||||
DomainDeleteInteraction::Delete.run(domain: domain)
|
||||
# ::PaperTrail.request.whodunnit = "job - #{self.class.name}"
|
||||
# WhoisRecord.where(domain_id: domain.id).destroy_all
|
||||
#
|
||||
# domain.destroy
|
||||
# bye_bye = domain.versions.last
|
||||
# domain.registrar.notifications.create!(
|
||||
# text: "#{I18n.t(:domain_deleted)}: #{domain.name}",
|
||||
# attached_obj_id: bye_bye.id,
|
||||
# attached_obj_type: bye_bye.class.to_s
|
||||
# )
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue