mirror of
https://github.com/internetee/registry.git
synced 2025-07-26 04:28:27 +02:00
Updated pending poll message #2557
This commit is contained in:
parent
86900fb839
commit
99dc2b1483
4 changed files with 5 additions and 5 deletions
|
@ -2,7 +2,7 @@ class DomainDeleteConfirmJob < Que::Job
|
||||||
def run(domain_id, action)
|
def run(domain_id, action)
|
||||||
# it's recommended to keep transaction against job table as short as possible.
|
# it's recommended to keep transaction against job table as short as possible.
|
||||||
ActiveRecord::Base.transaction do
|
ActiveRecord::Base.transaction do
|
||||||
domain = Epp::Domain.find(domain_id)
|
domain = Epp::Domain.find(domain_id).include(:registrar)
|
||||||
case action
|
case action
|
||||||
when RegistrantVerification::CONFIRMED
|
when RegistrantVerification::CONFIRMED
|
||||||
domain.poll_message!(:poll_pending_delete_confirmed_by_registrant)
|
domain.poll_message!(:poll_pending_delete_confirmed_by_registrant)
|
||||||
|
|
|
@ -2,7 +2,7 @@ class DomainUpdateConfirmJob < Que::Job
|
||||||
def run(domain_id, action)
|
def run(domain_id, action)
|
||||||
# it's recommended to keep transaction against job table as short as possible.
|
# it's recommended to keep transaction against job table as short as possible.
|
||||||
ActiveRecord::Base.transaction do
|
ActiveRecord::Base.transaction do
|
||||||
domain = Epp::Domain.find(domain_id)
|
domain = Epp::Domain.find(domain_id).include(:registrar)
|
||||||
case action
|
case action
|
||||||
when RegistrantVerification::CONFIRMED
|
when RegistrantVerification::CONFIRMED
|
||||||
domain.poll_message!(:poll_pending_update_confirmed_by_registrant)
|
domain.poll_message!(:poll_pending_update_confirmed_by_registrant)
|
||||||
|
|
|
@ -350,7 +350,7 @@ class Domain < ActiveRecord::Base
|
||||||
|
|
||||||
def poll_message!(message_key)
|
def poll_message!(message_key)
|
||||||
registrar.messages.create!(
|
registrar.messages.create!(
|
||||||
body: I18n.t(message_key),
|
body: "#{I18n.t(message_key)}: #{name}",
|
||||||
attached_obj_id: id,
|
attached_obj_id: id,
|
||||||
attached_obj_type: self.class.to_s
|
attached_obj_type: self.class.to_s
|
||||||
)
|
)
|
||||||
|
|
|
@ -419,9 +419,9 @@ describe Domain do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should add poll message to registrar' do
|
it 'should add poll message to registrar' do
|
||||||
domain = Fabricate(:domain)
|
domain = Fabricate(:domain, name: 'testpollmessage123.ee')
|
||||||
domain.poll_message!(:poll_pending_update_confirmed_by_registrant)
|
domain.poll_message!(:poll_pending_update_confirmed_by_registrant)
|
||||||
domain.registrar.messages.first.body.should == 'Registrant confirmed domain update'
|
domain.registrar.messages.first.body.should == 'Registrant confirmed domain update: testpollmessage123.ee'
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'about registrant update confirm' do
|
context 'about registrant update confirm' do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue