From 82c71e11f5de50f5cc5f4ed399107cb0544f1d9b Mon Sep 17 00:00:00 2001 From: Nicolas Rodriguez Date: Thu, 29 Aug 2024 03:47:02 +0200 Subject: [PATCH] Fix Rails 7.2 deprecation --- spec/config_rspec.rb | 6 +++++- spec/spec_helper.rb | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/spec/config_rspec.rb b/spec/config_rspec.rb index 8d6c1a4..0cf4b2c 100644 --- a/spec/config_rspec.rb +++ b/spec/config_rspec.rb @@ -9,7 +9,11 @@ load Rails.root.join('db', 'schema.rb').to_s # Set our fixtures path - config.fixture_path = File.expand_path('fixtures', __dir__) + if Rails.version >= '7.2' + config.fixture_paths = File.expand_path('fixtures', __dir__) + else + config.fixture_path = File.expand_path('fixtures', __dir__) + end # Run tests in random order config.order = :random diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 8842ecd..d31c2da 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -25,3 +25,9 @@ # Load our own config require_relative 'config_capybara' require_relative 'config_rspec' + +if Rails.version >= '7.2' + def fixture_path + fixture_paths + end +end