-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Warning http verb method call in SystemTestCase #29622
Warning http verb method call in SystemTestCase #29622
Conversation
Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @rafaelfranca (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. This repository is being automatically checked for code quality issues using Code Climate. You can see results for this analysis in the PR status below. Newly introduced issues should be fixed before a Pull Request is considered ready to review. Please see the contribution instructions for more information. |
module SystemTesting | ||
module TestHelpers | ||
module WarningHttpVerb # :nodoc: | ||
MESSAGE = "This is SystemTesting. You should use `visit` or any other Capybara API." |
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 would be nice to have a frozen string here:
MESSAGE = "This is SystemTesting. You should use `visit` or any other Capybara API.".freeze
# this is just a personal style guide, but this can also be a private constant
# private_constant :MESSAGE
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.
Don't need to freeze strings in Rails codebase, neither make constant private.
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.
I agree we should not allow those methods, but I'd prefer to undefine them instead of give a warning. That being said which other methods we don't want to allow?
r? @eileencodes
module SystemTesting | ||
module TestHelpers | ||
module WarningHttpVerb # :nodoc: | ||
MESSAGE = "This is SystemTesting. You should use `visit` or any other Capybara API." |
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.
Don't need to freeze strings in Rails codebase, neither make constant private.
162bb11
to
e36e0b8
Compare
e36e0b8
to
86b9800
Compare
@yalab awesome, thanks for working on this. Can you squash your commits into one and then I'll merge? Thanks! |
86b9800
to
1aea1dd
Compare
@eileencodes I quashed it. I honour to rails team. thanks to your comments. |
Summary
It show warnings if anyone use http verb method in SystemTestCase.
SystemTestCase should use visit or any other Capybara API.
It is useful to show warnings.