Rubocop: Wrong keyword argument use

Created on 25 Oct 2016  路  4Comments  路  Source: rubocop-hq/rubocop

Expected behavior

Rubocop should not correct put arguments in functional tests:

put :update, my: 'params'

Actual behavior

Hash parameter is passed as keyword argument using :params key
put :update, params: { my: 'params' }

Describe here what actually happened.

Steps to reproduce the problem

Create rails functional test:

  should 'should not correct' do
    get :show, { id: 1 }
  end

linter will spot a problem:
Use keyword arguments instead of positional arguments for http call

RuboCop version

$ rubocop -V
0.44.1 (using Parser 2.3.1.4, running on ruby 2.2.4 x86_64-darwin15)

Most helpful comment

yes,
disabling Rails/HttpPositionalArguments works, is there better solution?

All 4 comments

I'm guessing you're using Rails 4?

yes,
disabling Rails/HttpPositionalArguments works, is there better solution?

@lemingos: This cop only applies to Rails 5. We're discussing how to approach this in #3629. Disabling it is the right solution for now. 馃榾

OK thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

benoittgt picture benoittgt  路  3Comments

NobodysNightmare picture NobodysNightmare  路  3Comments

deivid-rodriguez picture deivid-rodriguez  路  3Comments

millisami picture millisami  路  3Comments

kirrmann picture kirrmann  路  3Comments