Updated pending poll message #2557

This commit is contained in:
Priit Tark 2015-08-10 14:31:17 +03:00
parent 86900fb839
commit 99dc2b1483
4 changed files with 5 additions and 5 deletions

View file

@ -2,7 +2,7 @@ class DomainDeleteConfirmJob < Que::Job
def run(domain_id, action)
# it's recommended to keep transaction against job table as short as possible.
ActiveRecord::Base.transaction do
domain = Epp::Domain.find(domain_id)
domain = Epp::Domain.find(domain_id).include(:registrar)
case action
when RegistrantVerification::CONFIRMED
domain.poll_message!(:poll_pending_delete_confirmed_by_registrant)

View file

@ -2,7 +2,7 @@ class DomainUpdateConfirmJob < Que::Job
def run(domain_id, action)
# it's recommended to keep transaction against job table as short as possible.
ActiveRecord::Base.transaction do
domain = Epp::Domain.find(domain_id)
domain = Epp::Domain.find(domain_id).include(:registrar)
case action
when RegistrantVerification::CONFIRMED
domain.poll_message!(:poll_pending_update_confirmed_by_registrant)

View file

@ -350,7 +350,7 @@ class Domain < ActiveRecord::Base
def poll_message!(message_key)
registrar.messages.create!(
body: I18n.t(message_key),
body: "#{I18n.t(message_key)}: #{name}",
attached_obj_id: id,
attached_obj_type: self.class.to_s
)

View file

@ -419,9 +419,9 @@ describe Domain do
end
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.registrar.messages.first.body.should == 'Registrant confirmed domain update'
domain.registrar.messages.first.body.should == 'Registrant confirmed domain update: testpollmessage123.ee'
end
context 'about registrant update confirm' do