78
78
79
79
include_examples "adds setting" , :global_fixtures
80
80
81
+ include_examples "adds setting" , :fixture_paths
82
+
83
+ # @deprecated TestFixtures#fixture_path is deprecated and will be removed in Rails 7.2
81
84
include_examples "adds setting" , :fixture_path
82
85
83
86
include_examples "adds setting" , :rendering_views
@@ -157,7 +160,27 @@ def in_inferring_type_from_location_environment
157
160
include_examples "infers type from location" , :feature , "spec/features"
158
161
end
159
162
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
161
184
in_sub_process do
162
185
RSpec . configuration . global_fixtures = [ :foo ]
163
186
RSpec . configuration . fixture_path = "custom/path"
@@ -169,7 +192,7 @@ def in_inferring_type_from_location_environment
169
192
expect ( group . fixture_path ) . to eq ( "custom/path" )
170
193
else
171
194
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" ] )
173
196
end
174
197
175
198
expect ( group . new . respond_to? ( :foo , true ) ) . to be ( true )
0 commit comments