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

Warning http verb method call in SystemTestCase #29622

Merged
merged 1 commit into from
Jul 1, 2017

Conversation

yalab
Copy link
Contributor

@yalab yalab commented Jun 29, 2017

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.

@rails-bot
Copy link

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."
Copy link
Contributor

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

Copy link
Member

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.

Copy link
Member

@rafaelfranca rafaelfranca left a 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."
Copy link
Member

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.

@yalab yalab force-pushed the warning_system_tesing_http_verb branch from 162bb11 to e36e0b8 Compare June 30, 2017 06:31
@yalab yalab force-pushed the warning_system_tesing_http_verb branch from e36e0b8 to 86b9800 Compare July 1, 2017 06:15
@eileencodes
Copy link
Member

@yalab awesome, thanks for working on this. Can you squash your commits into one and then I'll merge? Thanks!

@yalab yalab force-pushed the warning_system_tesing_http_verb branch from 86b9800 to 1aea1dd Compare July 1, 2017 14:30
@yalab
Copy link
Contributor Author

yalab commented Jul 1, 2017

@eileencodes I quashed it. I honour to rails team. thanks to your comments.

@eileencodes eileencodes merged commit c197418 into rails:master Jul 1, 2017
@yalab yalab deleted the warning_system_tesing_http_verb branch July 3, 2017 06:19
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

Successfully merging this pull request may close these issues.

5 participants