[英]Capybara's visit method returns : NoMethodError: undefined method `to_i' for true:TrueClass
I'm trying to go through the confirmation process : 我正在尝试通过确认过程:
request_url = "/users/confirmation?confirmation_token=azq32soznE1xuSWLjBat"
Then when I do : 然后,当我这样做时:
visit request_url
It returns : 它返回:
NoMethodError: undefined method `to_i' for true:TrueClass
I thought, originally, that this was Devise, but it doesn't hit any of my debuggers so it never even makes it there. 我本来以为这是Devise,但它没有打到我的任何调试器,所以它甚至都没有出现过。 What's even more puzzling was that I made no adjustments to this area of my app, so I'm very confused as to how this suddenly arose.
更加令人困惑的是,我没有对应用程序的这一区域进行任何调整,因此我对如何突然出现这种情况感到非常困惑。
Any ideas on how to debug this? 关于如何调试的任何想法?
My guess is the confirmation token doesn't exist. 我的猜测是确认令牌不存在。 Look at the code surrounding the error, you have something that is saying
查看错误周围的代码,您有句话在说
my_variable = true
my_variable.to_i
You're calling .to_i
somewhere on a boolean, which is no good. 您在布尔值的某个地方调用
.to_i
,这不好。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.