diff --git a/spec/jobs/bulk_visits_suggesting_job_spec.rb b/spec/jobs/bulk_visits_suggesting_job_spec.rb index 16a8086d..b63dfa81 100644 --- a/spec/jobs/bulk_visits_suggesting_job_spec.rb +++ b/spec/jobs/bulk_visits_suggesting_job_spec.rb @@ -58,7 +58,7 @@ RSpec.describe BulkVisitsSuggestingJob, type: :job do allow(User).to receive(:active).and_return(active_users_mock) allow(active_users_mock).to receive(:active).and_return(active_users_mock) allow(active_users_mock).to receive(:where).with(id: []).and_return(active_users_mock) - # allow(active_users_mock).to receive(:find_each).and_yield(user_with_points) + allow(active_users_mock).to receive(:find_each).and_yield(user_with_points) chunks.each do |chunk| expect(VisitSuggestingJob).to receive(:perform_later).with( @@ -100,11 +100,11 @@ RSpec.describe BulkVisitsSuggestingJob, type: :job do .and_return(time_chunks_instance) allow(time_chunks_instance).to receive(:call).and_return(custom_chunks) - # active_users_mock = double('ActiveRecord::Relation') - # allow(User).to receive(:active).and_return(active_users_mock) - # allow(active_users_mock).to receive(:active).and_return(active_users_mock) - # allow(active_users_mock).to receive(:where).with(id: []).and_return(active_users_mock) - # allow(active_users_mock).to receive(:find_each).and_yield(user_with_points) + active_users_mock = double('ActiveRecord::Relation') + allow(User).to receive(:active).and_return(active_users_mock) + allow(active_users_mock).to receive(:active).and_return(active_users_mock) + allow(active_users_mock).to receive(:where).with(id: []).and_return(active_users_mock) + allow(active_users_mock).to receive(:find_each).and_yield(user_with_points) expect(VisitSuggestingJob).to receive(:perform_later).with( user_id: user_with_points.id,