From e4695b492b43c6a73c2dae8a42826c7e09d192fb Mon Sep 17 00:00:00 2001 From: Shana Moore Date: Fri, 24 Jan 2025 16:15:23 -0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20Mock=20find=5For=5Fschedule=5Fjobs?= =?UTF-8?q?=20in=20account=20endpoints=20spec?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The account endpoints spec was failing because it attempted to schedule jobs before the tenant schema was created. By mocking find_or_schedule_jobs in this specific test, we avoid the schema error while preserving the actual job scheduling behavior in other tests. --- spec/features/accounts_spec.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/features/accounts_spec.rb b/spec/features/accounts_spec.rb index d8e412c2c..5ad12c7db 100644 --- a/spec/features/accounts_spec.rb +++ b/spec/features/accounts_spec.rb @@ -16,6 +16,7 @@ allow(Apartment::Tenant).to receive(:switch).with(account.tenant) do |&block| block.call end + allow_any_instance_of(Account).to receive(:find_or_schedule_jobs) end around do |example|