In my spec_helper.rb I added
config.include Devise::TestHelpers, :type => :controller
In the controller specification before: all hook I'am trying to log in using this code
@request.env["devise.mapping"] = Devise.mappings[:user] user = FactoryGirl.create(:confirmed_user) sign_in user
and get the NoMethodError: undefined method `env 'for nil: NilClass.
Any ideas?
ruby ruby-on-rails ruby-on-rails-4 rspec devise
Shkarik
source share