-
-
Notifications
You must be signed in to change notification settings - Fork 279
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/Rails/HaveHttpStatus
cop
#1307
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.
Looks good!
Just glanced over, let me run it on real-world-rspec
later today.
6cd4454
to
eb40985
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.
Checked on real-world-rspec
:
57497 files inspected, 3841 offenses detected, 3841 offenses auto-correctable
and all those thousands of offences look legit! 👏 🎉
Thank you! Fantastic contribution!
…: false` Fixes: #5 This is because `response.status` is not always the HTTP response as commented below. I don't think this is an autocorrect is not safe. What do you think? rubocop/rubocop-rspec#1307 (comment)
This cop checks that tests use
have_http_status
instead of equality matchers (e.g.be
).Example
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.