7878
7979 include_examples "adds setting" , :global_fixtures
8080
81+ include_examples "adds setting" , :fixture_paths
82+
83+ # @deprecated TestFixtures#fixture_path is deprecated and will be removed in Rails 7.2
8184 include_examples "adds setting" , :fixture_path
8285
8386 include_examples "adds setting" , :rendering_views
@@ -157,7 +160,27 @@ def in_inferring_type_from_location_environment
157160 include_examples "infers type from location" , :feature , "spec/features"
158161 end
159162
160- it "fixture support is included with metadata `:use_fixtures`" do
163+ it "fixture support is included with metadata `:use_fixtures` and fixture_paths configured" do
164+ in_sub_process do
165+ RSpec . configuration . global_fixtures = [ :foo ]
166+ RSpec . configuration . fixture_paths = [ "custom/path" , "other/custom/path" ]
167+
168+ group = RSpec . describe ( "Arbitrary Description" , :use_fixtures )
169+
170+ if ::Rails ::VERSION ::STRING < '7.1.0'
171+ expect ( group ) . to respond_to ( :fixture_path )
172+ expect ( group . fixture_path ) . to eq ( "custom/path" )
173+ else
174+ expect ( group ) . to respond_to ( :fixture_paths )
175+ expect ( group . fixture_paths ) . to eq ( [ "custom/path" , "other/custom/path" ] )
176+ end
177+
178+ expect ( group . new . respond_to? ( :foo , true ) ) . to be ( true )
179+ end
180+ end
181+
182+ # @deprecated TestFixtures#fixture_path is deprecated and will be removed in Rails 7.2
183+ it "fixture support is included with metadata `:use_fixtures` and fixture_path configured" do
161184 in_sub_process do
162185 RSpec . configuration . global_fixtures = [ :foo ]
163186 RSpec . configuration . fixture_path = "custom/path"
@@ -169,7 +192,7 @@ def in_inferring_type_from_location_environment
169192 expect ( group . fixture_path ) . to eq ( "custom/path" )
170193 else
171194 expect ( group ) . to respond_to ( :fixture_paths )
172- expect ( group . fixture_paths ) . to include ( "custom/path" )
195+ expect ( group . fixture_paths ) . to eq ( [ "custom/path" ] )
173196 end
174197
175198 expect ( group . new . respond_to? ( :foo , true ) ) . to be ( true )
0 commit comments