rubocop-rspec
rubocop-rspec copied to clipboard
RSpec/Capybara/FeatureMethods auto-correct is not safe
Given the following file:
RSpec.feature 'Shifts report show' do
end
RSpec/Capybara/FeatureMethods
will auto-correct to:
RSpec.expect 'Shifts report show' do
end
But that correction is not safe, since the example group now no longer has type: :feature
, which can lead to certain helpers not getting loaded (which is how I discovered the issue).
Either the correction should lead to type: :feature
getting added:
RSpec.expect 'Shifts report show', type: :feature do
end
Or the cop should not have auto-correct marked as safe.
Rubocop version: 1.57.2 Rubocop-rspec version: 2.25.0
memo) RSpec/Capybara/FeatureMethods
is a cop belonging to rubocop-rspec
- https://github.com/rubocop/rubocop-rspec/blob/master/lib/rubocop/cop/rspec/capybara/feature_methods.rb
Or the cop should not auto-correct top-level groups.
Thanks for reporting!
I am closing this issue, since the RSpec/Capybara/FeatureMethods cop was removed in #1876 / v3.0.0.