-
-
Notifications
You must be signed in to change notification settings - Fork 269
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 support be_status
style for RSpec/Rails/HttpStatus
#1527
Conversation
94e5ddc
to
684e42b
Compare
d05c7cb
to
2c5a1c0
Compare
I'd hold this off until |
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.
Wondering what are usage stats for various styles in real-world-rspec
repos.
@@ -41,12 +54,13 @@ class HttpStatus < Base | |||
PATTERN | |||
|
|||
def on_send(node) |
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.
It seems this cop has a bias towards the new style, as it inspects have_http_status
calls, but doesn't care if be_*
are used when configured to use numeric
or symbolic
styles.
It's not a big problem, since otherwise it would detect false positives in e.g. non-controller/request specs.
Maybe it makes sense to reflect this in our docs somehow.
|
@pirj Sorry for the late reply. And thanks for checking usage stats for various styles in |
# This cop inspects only `have_http_status` calls. | ||
# So, this cop do not check if a method starting with `be_*` is used | ||
# when setting for `EnforcedStyle: symbolic` or `EnforcedStyle: numeric`. |
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.
9c9711a
to
baad961
Compare
6315e13
to
fb347a3
Compare
Fix: #1148
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 modified an existing cop's configuration options:
VersionChanged: "<<next>>"
inconfig/default.yml
.