From a7f80997a87ab4e3b29a8a25b43255b356899609 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Oct 2026 09:33:33 +0000 Subject: [PATCH 1/2] Bump rubocop-rspec_rails from 2.32.0 to 2.33.0 Bumps [rubocop-rspec_rails](https://github.com/rubocop/rubocop-rspec_rails) from 2.32.0 to 2.33.0. - [Release notes](https://github.com/rubocop/rubocop-rspec_rails/releases) - [Changelog](https://github.com/rubocop/rubocop-rspec_rails/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop-rspec_rails/compare/v2.32.0...v2.33.0) --- updated-dependencies: - dependency-name: rubocop-rspec_rails dependency-version: 2.33.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index b74f4e1fa..8539a9170 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -327,7 +327,7 @@ GEM paper_trail (17.0.0) activerecord (>= 7.1) request_store (~> 1.4) - parallel (2.2.0) + parallel (2.3.0) parser (3.3.12.0) ast (~> 2.4.1) racc @@ -421,7 +421,7 @@ GEM prism (>= 1.6.0) rbs (>= 4.0.0) tsort - regexp_parser (2.13.0) + regexp_parser (2.13.1) reline (0.7.0) io-console (~> 0.5) request_store (1.7.0) @@ -487,9 +487,9 @@ GEM lint_roller (~> 1.1) regexp_parser (>= 2.0) rubocop (~> 1.86, >= 1.86.2) - rubocop-rspec_rails (2.32.0) + rubocop-rspec_rails (2.33.0) lint_roller (~> 1.1) - rubocop (~> 1.72, >= 1.72.1) + rubocop (~> 1.89) rubocop-rspec (~> 3.5) ruby-lsp (0.26.11) language_server-protocol (~> 3.17.0) From 3993e664ecd9b120545c8c80e06a5f49ad25efdc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 20 Oct 2026 08:23:34 +0000 Subject: [PATCH 2/2] Use have_enqueued_job to satisfy RSpecRails/ReceivePerformLater Co-authored-by: zetter-rpf <253059100+zetter-rpf@users.noreply.github.com> --- spec/concepts/school/import_batch_spec.rb | 29 +++++++------------ .../github_webhooks_controller_push_spec.rb | 11 +++---- 2 files changed, 15 insertions(+), 25 deletions(-) diff --git a/spec/concepts/school/import_batch_spec.rb b/spec/concepts/school/import_batch_spec.rb index 759c4d18f..63234238d 100644 --- a/spec/concepts/school/import_batch_spec.rb +++ b/spec/concepts/school/import_batch_spec.rb @@ -14,34 +14,27 @@ end let(:csv_file) { StringIO.new(csv_content) } - before do - allow(SchoolImportJob).to receive(:perform_later).and_return( - instance_double(SchoolImportJob, job_id: 'test-job-id') - ) - end - context 'with valid CSV' do it 'returns success response with job_id' do result = described_class.call(csv_file: csv_file, current_user: current_user) expect(result.success?).to be true - expect(result[:job_id]).to eq('test-job-id') + expect(result[:job_id]).to be_present expect(result[:total_schools]).to eq(2) end it 'enqueues SchoolImportJob' do - described_class.call(csv_file: csv_file, current_user: current_user) - - expect(SchoolImportJob).to have_received(:perform_later).with( - hash_including( - schools_data: array_including( - hash_including(name: 'Test School 1'), - hash_including(name: 'Test School 2') - ), - user_id: current_user.id, - token: current_user.token + expect { described_class.call(csv_file: csv_file, current_user: current_user) } + .to have_enqueued_job(SchoolImportJob).with( + hash_including( + schools_data: array_including( + hash_including(name: 'Test School 1'), + hash_including(name: 'Test School 2') + ), + user_id: current_user.id, + token: current_user.token + ) ) - ) end end diff --git a/spec/requests/github_webhooks/github_webhooks_controller_push_spec.rb b/spec/requests/github_webhooks/github_webhooks_controller_push_spec.rb index fc41fd7a0..298ba6872 100644 --- a/spec/requests/github_webhooks/github_webhooks_controller_push_spec.rb +++ b/spec/requests/github_webhooks/github_webhooks_controller_push_spec.rb @@ -24,14 +24,11 @@ } end - before do - allow(UploadJob).to receive(:perform_later) - post '/github_webhooks', env: { RAW_POST_DATA: params.to_json }, headers: - end + let(:post_webhook) { post '/github_webhooks', env: { RAW_POST_DATA: params.to_json }, headers: } shared_examples 'upload job' do it 'schedules the job' do - expect(UploadJob).to have_received(:perform_later).with(params) + expect { post_webhook }.to have_enqueued_job(UploadJob).with(params) end end @@ -60,7 +57,7 @@ let(:commits) { [{ added: ['en/step2.md'], modified: ['en/step1.md'], removed: ['en/step0.md'] }] } it 'does not schedule the upload job' do - expect(UploadJob).not_to have_received(:perform_later) + expect { post_webhook }.not_to have_enqueued_job(UploadJob) end end end @@ -70,7 +67,7 @@ let(:commits) { [{ added: [], modified: ['en/code/project1/main.py'], removed: [] }] } it 'does not schedule the upload job' do - expect(UploadJob).not_to have_received(:perform_later) + expect { post_webhook }.not_to have_enqueued_job(UploadJob) end end end