mirror of
https://github.com/internetee/registry.git
synced 2025-07-01 16:53:37 +02:00
parent
b953b1d46d
commit
0f23f5eea8
1 changed files with 5 additions and 3 deletions
|
@ -12,12 +12,14 @@ RSpec.describe DomainExpirationEmailJob do
|
||||||
let(:message) { instance_double(ActionMailer::MessageDelivery) }
|
let(:message) { instance_double(ActionMailer::MessageDelivery) }
|
||||||
|
|
||||||
before :example do
|
before :example do
|
||||||
|
allow(domain).to receive(:registrar).and_return('registrar')
|
||||||
allow(domain).to receive(:registered?).and_return(false)
|
allow(domain).to receive(:registered?).and_return(false)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'sends email notification' do
|
it 'sends email notification' do
|
||||||
expect(DomainMailer).to receive(:expiration).with(domain: domain).and_return(message)
|
expect(DomainExpireMailer).to receive(:expired).with(domain: domain, registrar: 'registrar')
|
||||||
expect(message).to receive(:deliver)
|
.and_return(message)
|
||||||
|
expect(message).to receive(:deliver_now)
|
||||||
described_class.enqueue(domain_id: 1)
|
described_class.enqueue(domain_id: 1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -28,7 +30,7 @@ RSpec.describe DomainExpirationEmailJob do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'does not send email notification' do
|
it 'does not send email notification' do
|
||||||
expect(DomainMailer).to_not receive(:expiration)
|
expect(DomainExpireMailer).to_not receive(:expired)
|
||||||
described_class.enqueue(domain_id: 1)
|
described_class.enqueue(domain_id: 1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue