From 31c0a08f8af2f6ebbcdea38698b0b93086918db1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Guitaut?= Date: Tue, 27 Aug 2024 14:49:07 +0200 Subject: [PATCH] DEV: Fix RSpec service matchers when a model is not found This is a follow-up of d749227e87bfc5df96a5b2fbace7601a83351633. This patch checks if the key `not_found` is present on the result object instead of calling `#blank?` on the model, as it can trigger an `ActiveRecord` relation. --- spec/support/service_matchers.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/support/service_matchers.rb b/spec/support/service_matchers.rb index e75e22ea350..7ef1571af40 100644 --- a/spec/support/service_matchers.rb +++ b/spec/support/service_matchers.rb @@ -99,7 +99,7 @@ module ServiceMatchers end def step_failed? - super && result[name].blank? + super && result[step].not_found end end