我试图调用一个方法在我的Rails 3的代码,但我得到:回报率:错误编号参数
Failure/Error: integration_sign_in wrong_user ArgumentError: wrong number of arguments (0 for 1)
下面是调用代码(在一个RSpec助手):
before(:each) do
wrong_user = Factory(:user, :email => "[email protected]", :password=>"hellohello", :password_confirmation => "hellohello")
integration_sign_in wrong_user
end
所以它明确地传递了一个论点。如果由于某种原因参数为空,是否会使它认为它不是一个参数?
RELEVANT BACKSTORY:为了测试,我只是从webrat切换到水豚。正如Railscast 257中所建议的,我还安装了launchy和database_cleaner gem。当我使用webrat时,上面的代码按预期工作,但现在(我认为与database_cleaner相关)出现问题。
可能相关的:在我spec_helper.rb我改成: config.use_transactional_fixtures = false
(即使“真”有同样的问题)
任何想法?谢谢。 。
我已经回答了下面的问题,但跟进:为什么堆栈跟踪这个错误?它使它大量混淆。该方法在spec_helper.rb文件中,其中堆栈无法达到(抓住吸管)? – skaz 2011-04-16 00:19:03