Skip to content

Commit

Permalink
Silence deprecation warnings for fixture_path in Rails >= 7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
cjlarose committed Mar 16, 2024
1 parent eba1d09 commit 6786663
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 6786663

Please sign in to comment.