简体   繁体   English

黄瓜在测试模式下找不到我可以在开发模式下看到的路线

[英]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.

相关问题 如何将开发模式切换为生产模式? - How can I switch development mode to production mode? 如何在开发模式下控制Rails / Webrick调试日志记录? - How can I control rails/webrick debug logging in development mode? 如何配置ActionMailer以在开发模式下有条件地发送电子邮件? - How can I configure ActionMailer to conditionally send emails in development mode? 我该怎么做才能加速Rails开发模式? - What can I do to speed up Rails development mode? 如何为开发模式的链接配置Rails 3.0.7主机? - How can I configure Rails 3.0.7 host for links for development mode? 为什么在开发模式下使用SendGrid SMTP Relay从Heroku Rails应用程序发送的收件箱中没有收到任何电子邮件? - Why can't I see any emails in my inbox sent from my Heroku Rails app using SendGrid SMTP Relay in development mode? ActionMailer和开发模式,它可以写入文件或其他东西吗? - ActionMailer and development mode, can it write to a file or something? 如何在开发模式下模拟Amazon Route53? - How to mock Amazon Route53 in development mode? Rails不在开发模式下的Rails 4.0.x中找到供应商/资产吗? - Rails is not finding vendor/assets in Rails 4.0.x in development mode? 如何在生产模式下测试邮件配置 - How can i test mail configuration in production mode
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM