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

Add missing keywords for Rails/HttpPositionalArguments #3654

Conversation

eitoball
Copy link
Contributor

This PR adds more keywords for Rails/HttpPositionalArgument cop.

The warning for positional arguments exists in both ActionDispatch::IntegrationTest and ActionController::TestCase. There are missing keywords in #3365.

$ git clone [email protected]:rails/rails.git
$ cd rails
$ git checkout v5.0.0.1
$ ag  REQUEST_KWARGS
actionpack/lib/action_controller/test_case.rb
638:      REQUEST_KWARGS = %i(params session flash method body xhr)
642:          args[0].keys.any? { |k| REQUEST_KWARGS.include?(k) }

actionpack/lib/action_dispatch/testing/integration.rb
303:        REQUEST_KWARGS = %i(params headers env xhr as)
305:          args[0].respond_to?(:keys) && args[0].keys.any? { |k| REQUEST_KWARGS.include?(k) }
312:            #{REQUEST_KWARGS.join(', ')}

@eitoball eitoball force-pushed the add-more-keywords-for-rails-http_positional_arguments branch from f5be1df to 11d758b Compare October 20, 2016 14:12
@bbatsov
Copy link
Collaborator

bbatsov commented Oct 20, 2016

This should also have a changelog entry.

@eitoball eitoball force-pushed the add-more-keywords-for-rails-http_positional_arguments branch 2 times, most recently from b6a1cad to 5ac4b52 Compare October 20, 2016 15:03
@bbatsov bbatsov merged commit 7307ecc into rubocop:master Oct 20, 2016
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.

2 participants