Cucumber 在测试模式下找不到我在开发模式下可以看到的路线
在开发模式下,我可以将浏览器指向 http://localhost:3000/brands/,然后我会看到所有品牌的列表,指示路由映射、控制器中的索引操作以及index.html.haml
文件都在做它们的工作。
我记得运行rake db:test:clone
。
在 /features/support/paths.rb
中,我有:
def path_to(page_name)
case page_name
when /the home\s?page/
'/'
when /the Brand\s?page/
'/brands'
end
但是当我运行 cucumber features
时,我得到:
When I am on the Brand page # features/step_definitions/web_steps.rb:44
No route matches "/brands" (ActionController::RoutingError)
您将如何找到此问题的原因?
谢谢,
史蒂文。
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.
I have remembered to run rake db:test:clone
.
In /features/support/paths.rb
I have:
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:
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 Rails URL 助手:
Use rails URL helper: