Skip to content

Commit

Permalink
Silence deprecation warnings for fixture_path in Rails >= 7.1 (#357)
Browse files Browse the repository at this point in the history
  • Loading branch information
cjlarose authored Mar 16, 2024
1 parent 89b7982 commit 9c23cbb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand All @@ -84,6 +91,8 @@ def self.reset
end
end
end

config.include FixturePathHelper
end

##
Expand Down

0 comments on commit 9c23cbb

Please sign in to comment.