From a1e83991fa15bb5b54c1e4caa309e17c90c904b0 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Fri, 19 Sep 2025 21:48:43 +0200 Subject: [PATCH] Fix jobs specs --- spec/jobs/bulk_visits_suggesting_job_spec.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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,