Skip to content

Latest commit

 

History

History
24 lines (19 loc) · 799 Bytes

include-devise-helpers-in-your-controller-tests.md

File metadata and controls

24 lines (19 loc) · 799 Bytes

Include Devise Helpers In Your Controller Tests

For past versions of Devise, you could include DeviseHelpers as part of controller or request type tests to have access to the sign_in and sign_out helpers.

RSpec.configure do |config|
  config.include Devise::TestHelpers, :type => :controller
end

As of Devise 4.2.0+, the Devise::TestHelpers have been deprecated. The Devise::Test::ControllerHelpers module should instead be included.

RSpec.configure do |config|
  config.include Devise::Test::ControllerHelpers, :type => :controller
end

source