-
-
Notifications
You must be signed in to change notification settings - Fork 277
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
Add new RSpec/Capybara/NegationMatcher
cop
#1405
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For spec completeness, can you add:
Case with heredoc for have_text (usually those are trickier for auto-correction, though we have some nice helpers to deal with those)
Test with argument, e.g. expect(page).not_to have_css('a') being corrected to expect(page).to have_no_css('a')
e797c6d
to
88ab916
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
Thank you for another useful contribution, @ydah!
Small suggestions below.
Would the cop tolerate compound expectations like:
expect(page)
.to have_no_css('foo')
.and have_no_css('bar')
And does it even make sense to insist on using not_to
for compound expectations? (Similar to I believe #1349).
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
bca5607
to
06d76fd
Compare
f871872
to
e877c41
Compare
2e3a942
to
3af2035
Compare
Thank you, @ydah ! |
Resolve: #378
Before submitting the PR make sure the following are checked:
master
(if not - rebase it).CHANGELOG.md
if the new code introduces user-observable changes.bundle exec rake
) passes (be sure to run this locally, since it may produce updated documentation that you will need to commit).If you have created a new cop:
config/default.yml
.Enabled: pending
inconfig/default.yml
.Enabled: true
in.rubocop.yml
.VersionAdded
indefault/config.yml
to the next minor version.If you have modified an existing cop's configuration options:
VersionChanged
inconfig/default.yml
to the next major version.