mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-06 02:51:34 +00:00
Test execution of BulkInvoiceService#start_pdf_job
The spec just tested if a job was enqueued, but not if the job can actually be executed. Unfortunately, this test is quite slow.
This commit is contained in:
@@ -11,6 +11,17 @@ describe BulkInvoiceService do
|
||||
|
||||
expect(Delayed::Job.last.payload_object.method_name).to eq :start_pdf_job_without_delay
|
||||
end
|
||||
|
||||
it "creates a PDF invoice" do
|
||||
order = create(:completed_order_with_fees)
|
||||
order.bill_address = order.ship_address
|
||||
order.save!
|
||||
|
||||
service.start_pdf_job([order.id])
|
||||
Delayed::Job.last.invoke_job
|
||||
|
||||
expect(service.invoice_created?(service.id)).to be_truthy
|
||||
end
|
||||
end
|
||||
|
||||
describe "#invoice_created?" do
|
||||
|
||||
Reference in New Issue
Block a user