From 4febfcb48097fbfc90de9aeaf0fa1de54e6a8a92 Mon Sep 17 00:00:00 2001 From: Mathieu Jobin Date: Tue, 9 Jul 2024 21:17:46 +0900 Subject: [PATCH] use plurial fixture_paths for rails 7.1+ --- spec/spec_helper.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 4bec5290a..5b79e4b7b 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -61,8 +61,11 @@ def fail(msg) config.mock_with :rspec - # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures - config.fixture_path = "#{Rails.root}/spec/fixtures" + if Rails.version >= "7.1" + config.fixture_paths = ["#{::Rails.root}/spec/fixtures"] + else + config.fixture_path = "#{::Rails.root}/spec/fixtures" + end # If you're not using ActiveRecord, or you'd prefer not to run each of your # examples within a transaction, remove the following line or assign false