File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,12 @@ def run_in_transaction?
2121 if RSpec . configuration . use_active_record?
2222 include Fixtures
2323
24- self . fixture_path = RSpec . configuration . fixture_path
24+ # TestFixtures#fixture_path is deprecated and will be removed in Rails 7.2
25+ if respond_to? ( :fixture_paths= )
26+ fixture_paths << RSpec . configuration . fixture_path
27+ else
28+ self . fixture_path = RSpec . configuration . fixture_path
29+ end
2530 self . use_transactional_tests = RSpec . configuration . use_transactional_fixtures
2631 self . use_instantiated_fixtures = RSpec . configuration . use_instantiated_fixtures
2732
Original file line number Diff line number Diff line change @@ -164,8 +164,14 @@ def in_inferring_type_from_location_environment
164164
165165 group = RSpec . describe ( "Arbitrary Description" , :use_fixtures )
166166
167- expect ( group ) . to respond_to ( :fixture_path )
168- expect ( group . fixture_path ) . to eq ( "custom/path" )
167+ if ::Rails ::VERSION ::STRING < '7.1.0'
168+ expect ( group ) . to respond_to ( :fixture_path )
169+ expect ( group . fixture_path ) . to eq ( "custom/path" )
170+ else
171+ expect ( group ) . to respond_to ( :fixture_paths )
172+ expect ( group . fixture_paths ) . to include ( "custom/path" )
173+ end
174+
169175 expect ( group . new . respond_to? ( :foo , true ) ) . to be ( true )
170176 end
171177 end
You can’t perform that action at this time.
0 commit comments