所有的Ruby测试提高:nil:NilClass的未定义方法“ authenticate”
我的大部分测试都提出了以下问题,但我不明白为什么。所有方法调用都会引发“身份验证”错误。我已经检查了代码中是否存在一种称为“ authenticate”的方法,但是没有这种方法。 1) Admin::CommentsController handling GET to index is successful Failure/Error: get :index undefined method `authenticate!' for nil:NilClass # ./spec/controllers/admin/comments_controller_spec.rb:9:in `block (3 levels) in <top (required)>' 124) PostsController handling GET for a single post should render show template Failure/Error: get :show, :year => '2008', :month => '01', :day => '01', …