From 764e35e198988a1ab7fcf46c9ca806fe1cd82eaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Tue, 15 Sep 2020 12:43:40 +0300 Subject: [PATCH] Make payable argument required --- app/jobs/send_e_invoice_job.rb | 2 +- app/models/registrar.rb | 2 +- test/jobs/send_e_invoice_job_test.rb | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/jobs/send_e_invoice_job.rb b/app/jobs/send_e_invoice_job.rb index 91e068b9f..e3880963e 100644 --- a/app/jobs/send_e_invoice_job.rb +++ b/app/jobs/send_e_invoice_job.rb @@ -1,5 +1,5 @@ class SendEInvoiceJob < Que::Job - def run(invoice_id, payable: true) + def run(invoice_id, payable = true) invoice = run_condition(Invoice.find_by(id: invoice_id), payable: payable) invoice.to_e_invoice(payable: payable).deliver diff --git a/app/models/registrar.rb b/app/models/registrar.rb index e5020d83f..e2ffcbfd4 100644 --- a/app/models/registrar.rb +++ b/app/models/registrar.rb @@ -104,7 +104,7 @@ class Registrar < ApplicationRecord InvoiceMailer.invoice_email(invoice: invoice, recipient: billing_email).deliver_now end - SendEInvoiceJob.enqueue(invoice.id, payable: payable) + SendEInvoiceJob.enqueue(invoice.id, payable) invoice end diff --git a/test/jobs/send_e_invoice_job_test.rb b/test/jobs/send_e_invoice_job_test.rb index 384479e92..86d761b42 100644 --- a/test/jobs/send_e_invoice_job_test.rb +++ b/test/jobs/send_e_invoice_job_test.rb @@ -13,7 +13,7 @@ class SendEInvoiceJobTest < ActiveSupport::TestCase EInvoice::Providers::TestProvider.deliveries.clear assert_nothing_raised do - SendEInvoiceJob.enqueue(@invoice.id) + SendEInvoiceJob.enqueue(@invoice.id, true) end @invoice.reload @@ -29,7 +29,7 @@ class SendEInvoiceJobTest < ActiveSupport::TestCase stub_request(:get, "https://testfinance.post.ee/finance/erp/erpServices.wsdl").to_timeout assert_raise HTTPClient::TimeoutError do - SendEInvoiceJob.enqueue(@invoice.id) + SendEInvoiceJob.enqueue(@invoice.id, true) end assert @invoicee_invoice_sent_at.blank? @@ -37,7 +37,7 @@ class SendEInvoiceJobTest < ActiveSupport::TestCase EInvoice::Providers::TestProvider.deliveries.clear assert_nothing_raised do - SendEInvoiceJob.enqueue(@invoice.id) + SendEInvoiceJob.enqueue(@invoice.id, true) end @invoice.reload