I'm working on my first app since I installed Rails 5. When I ran my specs for controller actions, I got the warning message below even though all my tests were passing.
[Devise] including `Devise::TestHelpers` is deprecated and will be removed from Devise.
For controller tests, please include `Devise::Test::ControllerHelpers` instead.
So in spec/rails_helper.rb
I change this line:
config.include Devise::TestHelpers, type: :controller
to
config.include Devise::Test::ControllerHelpers
This change made the warning go away, but now the specs for models are failing. (They were passing before the change.) How should I fix this? Thanks!
You should change your spec/rails_helper.rb
file to the following:
config.include Devise::Test::ControllerHelpers, type: :controller
This will ensure that the Devise::Test::ControllerHelpers
module is only be included in your controller tests. The reason your model tests are failing is because that module is specific to controller tests.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With