[英]Cucumber not finding a route in test mode that I can see in development mode
In development mode, I can point my browser at http://localhost:3000/brands/
and I see a list of all brands, indicating that the route mapping, the index action in the controller and the index.html.haml
file are all doing their job. 在开发模式下,我可以将浏览器指向
http://localhost:3000/brands/
并且看到所有品牌的列表,表明路由映射,控制器中的index操作和index.html.haml
文件是都在做他们的工作。
I have remembered to run rake db:test:clone
. 我记得运行过
rake db:test:clone
。
In /features/support/paths.rb
I have: 在
/features/support/paths.rb
我有:
def path_to(page_name)
case page_name
when /the home\s?page/
'/'
when /the Brand\s?page/
'/brands'
end
But when I run cucumber features
, I get: 但是当我运行
cucumber features
,我得到:
When I am on the Brand page # features/step_definitions/web_steps.rb:44
No route matches "/brands" (ActionController::RoutingError)
How would you go about finding the cause of this problem? 您将如何查找此问题的原因?
Thanks, 谢谢,
Steven. 史蒂文
Use rails URL helper: 使用Rails URL助手:
when /the Brand\s?page/
brands_path
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.