After loading the Rails console, how should I sign in a user?
Devise provides a test helper which can be used in tests and I've tried to use in console:
>> include Devise::TestHelpers
>> helper.sign_in(User.first)
But I get:
NoMethodError: undefined method `env' for nil:NilClass
Anyway, I would like to use the real devise helper and not this test helper. Is there any way to achieve this?
email
instead oflogin
:app.post('/sign_in', {"user"=>{"email"=>"login", "password"=>"password"}})
– Transversal