尝试从 Rails 4.1 升级到 rails 4.2 并在此过程中从 3.0 设计到 3.4(由于 3.0 的依赖关系)
我有一个非常基本的控制器:
class BasicController < ActionController::Base
#purposely not inherited from Application Controller to try and isolate the issue
before_filter :authenticate_user!
def index
end
end
routes.rb 包含:
get 'basic/index'
我对这个控制器的规格是:
#purposely not included spec_helper as I don't want to complicate things.
1.describe BasicController do
2. it "should be able to get index" do
3. @request.env['devise.mapping'] = Devise.mappings[:user]
4. @current_user = FactoryGirl.create(:user)
5. sign_in :user, @current_user #Also tried sign_in @current_user
6. get :index
7. response.should be_success
8. end
9.end
此规范错误ArgumentError: wrong number of arguments (2 for 1) #./spec/controllers/basic_controller_spec.rb:6
使用 devise 3.4.1 和 rails 4.2.0
如果我用简单的 User.create(....) 替换工厂女孩,错误仍然会发生。
任何想法为什么会发生这种情况?