dawarich/spec/jobs/area_visits_calculation_scheduling_job_spec.rb

18 lines
483 B
Ruby
Raw Permalink Normal View History

# frozen_string_literal: true
2024-07-24 14:25:16 -04:00
require 'rails_helper'
RSpec.describe AreaVisitsCalculationSchedulingJob, type: :job do
describe '#perform' do
2025-07-20 12:57:53 -04:00
let(:user) { create(:user) }
let(:area) { create(:area, user: user) }
it 'calls the AreaVisitsCalculationService' do
2025-09-18 12:29:46 -04:00
allow(User).to receive(:find_each).and_yield(user)
2025-07-20 12:57:53 -04:00
expect(AreaVisitsCalculatingJob).to receive(:perform_later).with(user.id).and_call_original
2025-07-12 07:43:15 -04:00
2025-07-20 12:57:53 -04:00
described_class.new.perform
end
end
2024-07-24 14:25:16 -04:00
end