Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cored/e122f21d39a2d9d7f5c93d8662c2e701 to your computer and use it in GitHub Desktop.
Save cored/e122f21d39a2d9d7f5c93d8662c2e701 to your computer and use it in GitHub Desktop.
require 'sidekiq/testing'
RSpec.describe Billing::Workers::SynchronizeCanadaInvoicesMonthlyWorker do
subject(:synchronize_invoices_worker) { described_class }
before do
Sidekiq::Testing.inline!
allow(Invoices::Synchronize).to receive(:call)
end
describe '.perform' do
context 'when current Month' do
it 'synchronize invoices' do
Timecop.freeze '2020-07-1' do
synchronize_invoices_worker.perform_async
expect(
Invoices::Synchronize
).to have_received(:call).with(2020, 7)
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment