current_user must be defined before the impersonates method when using the Clearance gem
conwayanderson opened this issue · 3 comments
conwayanderson commented
ankane commented
Hey @conwayanderson, thanks for reporting 👍 This is fixed on master.
rbazinet commented
@ankane I'm getting this error in and RSpec test. Any suggestions on what's needed to test my controller methods that use Pretender?
It would be great to see some examples or guidance on testing impersonation in my controller.
armansa commented
I have same problem. To fix it I added devise_for :users, only: []
in config/routes.rb
But then tests fail.