Rails 4 - undefined method 'authenticate' for nil:NilClass
问题 I'm working on a course building a social network using Rails 4 & Devise. I'm stuck trying to get a course to pass, this is the error I'm getting: 1) Error: UserFriendshipsControllerTest#test_: #new when not logged in should get redirected to the login page. : NoMethodError: undefined method `authenticate!' for nil:NilClass test/controllers/user_friendships_controller_test.rb:8:in `block (3 levels) in <class:UserFriendshipsControllerTest>' This is my users_friendships_controller_test.rb :