mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-24 05:38:52 +00:00
16 lines
432 B
Ruby
16 lines
432 B
Ruby
require 'spec_helper'
|
|
|
|
describe OrderCycleNotificationJob do
|
|
let(:order_cycle) { create(:order_cycle) }
|
|
let(:mail) { double(:mail, deliver: true) }
|
|
|
|
before do
|
|
allow(ProducerMailer).to receive(:order_cycle_report).twice.and_return(mail)
|
|
end
|
|
|
|
it 'sends a mail to each supplier' do
|
|
run_job OrderCycleNotificationJob.new(order_cycle.id)
|
|
expect(ProducerMailer).to have_received(:order_cycle_report).twice
|
|
end
|
|
end
|