Skip to content

Commit 8af9748

Browse files
committed
Comment out infer_spec_type_from_file_location! in generated rails_helper.rb
1 parent c7d4200 commit 8af9748

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

lib/generators/rspec/install/templates/spec/rails_helper.rb

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,20 +67,22 @@
6767
# config.use_transactional_fixtures = true
6868
6969
<% end -%>
70-
# RSpec Rails can automatically mix in different behaviours to your tests
71-
# based on their file location, for example enabling you to call `get` and
72-
# `post` in specs under `spec/controllers`.
70+
# RSpec Rails uses metadata to mix in different behaviours to your tests,
71+
# for example enabling you to call `get` and `post` in request specs. e.g.:
7372
#
74-
# You can disable this behaviour by removing the line below, and instead
75-
# explicitly tag your specs with their type, e.g.:
76-
#
77-
# RSpec.describe UsersController, type: :controller do
73+
# RSpec.describe UsersController, type: :request do
7874
# # ...
7975
# end
8076
#
8177
# The different available types are documented in the features, such as in
8278
# https://rspec.info/features/7-0/rspec-rails
83-
config.infer_spec_type_from_file_location!
79+
#
80+
# You can also this infer these behaviours automatically by location, e.g.
81+
# /spec/models would pull in the same behaviour as `type: :model` but this
82+
# behaviour is considered legacy and will be removed in a future version.
83+
#
84+
# To enable this behaviour uncomment the line below.
85+
# config.infer_spec_type_from_file_location!
8486
8587
# Filter lines from Rails gems in backtraces.
8688
config.filter_rails_from_backtrace!

0 commit comments

Comments
 (0)