Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capybara/FeatureMethods conflicts with RSpec/DescribeClass in feature specs #538

Closed
mvz opened this issue Jan 19, 2018 · 7 comments
Closed

Comments

@mvz
Copy link
Contributor

mvz commented Jan 19, 2018

rubocop-rspec should support rspec-rails' feature specs, however:

The following gives a RSpec/DescribeClass offense:

RSpec.describe 'user does foo', type: :feature do
  it 'succesfully foos the bar' do
    ...
  end
end

The following gives a Capybara/FeatureMethods offense:

RSpec.feature 'user does foo', type: :feature do
  scenario 'succesfully fooing the bar' do
    ...
  end
end
@Darhazer
Copy link
Member

Darhazer commented Apr 6, 2018

@mvz would #593 work for you?

@mvz
Copy link
Contributor Author

mvz commented Apr 15, 2018

@Darhazer I'm not sure. I was going to write a response based on reasoning, but I concluded I need to give this a try and see how it works out.

@mvz
Copy link
Contributor Author

mvz commented Apr 15, 2018

@Darhazer I'm afraid 75baab3 broke this cop completely for me, so it now never complains!

@mvz
Copy link
Contributor Author

mvz commented Apr 15, 2018

Ok, I've changed my code so the cop works for now and tested this. I'm afraid #593 doesn't really help, because I would want to enable all methods, so this would be no different from just disabling the cop for the spec/features directory.

Ideally, for me, rubocop-rspec would only allow the regular rspec methods in 'regular' specs, and only allow the feature methods in feature test.

@Darhazer
Copy link
Member

Well, I guess you have to add the features spec folder to Exclude for the DescribeClass cop

@mvz
Copy link
Contributor Author

mvz commented Apr 26, 2018

@Darhazer Yes, that's what I did. An alternative for users who want the FeatureMethods cop enabled is to disable DescribeClass for the features spec folder.

@bquorning
Copy link
Collaborator

I am closing this issue, since the RSpec/Capybara/FeatureMethods cop was removed in #1876 / v3.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants