heartcombo / devise

Flexible authentication solution for Rails with Warden.
http://blog.plataformatec.com.br/tag/devise/
MIT License
23.89k stars 5.54k forks source link

Still got warning controller_helpers.rb:35 #5550

Closed nishijima-precena closed 1 year ago

nishijima-precena commented 1 year ago

Environment

Current behavior

~/vendor/bundle/ruby/2.7.0/gems/devise-4.8.1/lib/devise/test/controller_helpers.rb:35: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
~/vendor/bundle/ruby/2.7.0/gems/actionpack-6.0.6.1/lib/action_controller/test_case.rb:460: warning: The called method `process' is defined here

Current code:

34: def process(*) 35: _catch_warden { super } 36: 37: @response 38: end 39: 40: ruby2_keywords(:process) if respond_to?(:ruby2_keywords, true)

Expected behavior

no warnings

Supplement

I thought the following issue had already solved the problem, but it still occurs, so I created an issue.

https://github.com/heartcombo/devise/issues/5234

https://github.com/heartcombo/devise/pull/5235

https://github.com/heartcombo/devise/pull/5214

carlosantoniodasilva commented 1 year ago

I tried to repro this in a new app running Rails 6.0.6.1 and latest devise, without success. Would you be able to provide a sample that shows the warning? If you tweak the Devise gem code to add the ** as suggested, does it work for you?

Also of note: using ActionController::TestCase and including Controller Helpers for Rails 5 and above should no longer be necessary, instead those tests should use Integration Helpers, as long as they inherit from ActionDispatch::IntegrationTest.

nishijima-precena commented 1 year ago

@carlosantoniodasilva

Thanks for the reply.

As you suggested, I tweaked the devise source code and found that it was caused by another gem. I updated that gem and the devise code is still the original and the warnings are no longer there at all.

carlosantoniodasilva commented 1 year ago

@nishijima-precena awesome!