mirror of
https://github.com/internetee/registry.git
synced 2025-07-01 08:43:37 +02:00
parent
962e98317d
commit
a6de3761c5
57 changed files with 238 additions and 203 deletions
|
@ -822,17 +822,19 @@ RSpec.describe Domain, db: false do
|
|||
|
||||
describe '#pending_delete!' do
|
||||
let(:domain) { described_class.new }
|
||||
let(:previous_registrant) { instance_double(Registrant) }
|
||||
let(:old_registrant) { instance_double(Registrant) }
|
||||
let(:message) { instance_double(Mail::Message) }
|
||||
|
||||
before :example do
|
||||
expect(Registrant).to receive(:find).and_return(previous_registrant)
|
||||
expect(Registrant).to receive(:find).and_return(old_registrant)
|
||||
allow(domain).to receive(:registrant_verification_asked?).and_return(true)
|
||||
allow(domain).to receive(:save)
|
||||
end
|
||||
|
||||
it 'sends notification email' do
|
||||
expect(DomainMailer).to receive(:pending_deleted).with(domain: domain, registrant: previous_registrant).and_return(message)
|
||||
expect(DeleteDomainMailer).to receive(:pending)
|
||||
.with(domain: domain, old_registrant: old_registrant)
|
||||
.and_return(message)
|
||||
expect(message).to receive(:deliver)
|
||||
domain.pending_delete!
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue