我用 rspec 做了一个测试,我写了
before { visit edit_password_reset_path(user.password_reset_token) }
我运行相关的测试,在这里我得到了:
No route matches [GET] "/password_resets/edit"
为了理解为什么它不起作用,我想知道user.password_reset_token
中有什么.
如何在运行测试时显示该变量?
简单地说:
before do
puts user.password_reset_token
visit edit_password_reset_path(user.password_reset_token)
end