简体   繁体   中英

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. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM