Skip to content

Commit 9c23cbb

Browse files
authored
Silence deprecation warnings for fixture_path in Rails >= 7.1 (#357)
1 parent 89b7982 commit 9c23cbb

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

spec/spec_helper.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@
5959
end
6060
end
6161

62+
module FixturePathHelper
63+
def fixture_path
64+
# Call fixture_paths.first in Rails >= 7.1 to avoid deprecation warnings
65+
respond_to?(:fixture_paths) ? fixture_paths.first : super
66+
end
67+
end
68+
6269
##
6370
# Common Rspec configure
6471
#
@@ -84,6 +91,8 @@ def self.reset
8491
end
8592
end
8693
end
94+
95+
config.include FixturePathHelper
8796
end
8897

8998
##

0 commit comments

Comments
 (0)