Closed dvodvo closed 1 year ago
A second test, using the synax from the repository 's tests
require "test_helper"
class ThisKlassControllerTest < ActionDispatch::IntegrationTest
include Warden::Test::Helpers
include Devise::Test::IntegrationHelpers
test "should login " do
sign_in(users(:one))
assert warden.authenticated?(:user)
end
returns NameError: undefined local variable or method
warden' for [...]ControllerTest[...]
Did you mean? warn`
seem to indicate a problem with warden of its inclusion.
Having created a second application with the same methods and routes, it is determined the issue lies not with devise, but in the testing environment being somehow corrupted.
Current behavior
a test aims to determine if a user is logged in, where
users(:one)
fixture has email defined, but not an encrypted password stated.via a test_helper method
Returns
The application runs authentication as expected and will display
warden.user.user.key
Thus, there may be an issue with the inclusion of Devise::Test::IntegrationHelpers - or something else is missing/wrong in the above approach.