dawarich/spec/jobs/stat_creating_job_spec.rb

21 lines
452 B
Ruby
Raw Normal View History

require 'rails_helper'
RSpec.describe StatCreatingJob, type: :job do
2024-04-02 17:20:25 -04:00
describe '#perform' do
let(:user) { create(:user) }
subject { described_class.perform_now([user.id]) }
before do
allow(CreateStats).to receive(:new).and_call_original
allow_any_instance_of(CreateStats).to receive(:call)
end
it 'creates a stat' do
subject
expect(CreateStats).to have_received(:new).with([user.id])
end
end
end