From 9c23cbbd44ce3226f9fc3a524a37efa07bb5c2a8 Mon Sep 17 00:00:00 2001 From: Chris LaRose Date: Sat, 16 Mar 2024 00:11:18 -0700 Subject: [PATCH] Silence deprecation warnings for fixture_path in Rails >= 7.1 (#357) --- spec/spec_helper.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 244b76b8..ca0739e7 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -59,6 +59,13 @@ end end +module FixturePathHelper + def fixture_path + # Call fixture_paths.first in Rails >= 7.1 to avoid deprecation warnings + respond_to?(:fixture_paths) ? fixture_paths.first : super + end +end + ## # Common Rspec configure # @@ -84,6 +91,8 @@ def self.reset end end end + + config.include FixturePathHelper end ##