Rails 3 rspec +水豚 - current_path 为零?
我的 users_spec.rb 中有这个
scenario "Go to contact page" do
visit "/contact"
current_path.should == contact_path
end
运行 rspec 后,我得到
Failure/Error: current_path.should == contact_path
expected: "/contact"
got: nil (using ==)
由于某种原因, current_path 似乎返回 nil 。是否有我缺少的配置?
I have this in my users_spec.rb
scenario "Go to contact page" do
visit "/contact"
current_path.should == contact_path
end
After running rspec, I get
Failure/Error: current_path.should == contact_path
expected: "/contact"
got: nil (using ==)
For some reason, current_path seem to be returning nil. Is there a configuration that I am missing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
作者回答:
罗敏明
Authors answer:
Min Ming Lo