黄瓜新路径

发布于 2024-08-09 05:28:32 字数 158 浏览 1 评论 0原文

这个问题的答案应该是微不足道的。有什么方法可以进入黄瓜路径中给定 AR 对象的显示操作路径。(我正在使用工厂来设置测试 AR 对象)。

我可以在 paths.rb 中引用新路径、编辑路径和索引路径,但是当涉及到显示操作时,它需要指定对象,并且有没有办法在 paths.rb 上引用该对象

The answer for this question should be trivial. Is there any way to get in to the show action path to a given AR object within cucumber paths.(I am using factories to set up test AR objects).

I can refer in paths.rb new, edit and index paths but when it comes to show action it needs to specify the object and is there a way to refer that object on the paths.rb

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

世界等同你 2024-08-16 05:28:32

我不太确定我理解这个问题 - 您希望能够访问模型特定实例的“显示”页面吗?

像这样的东西会起作用吗? (取自 features/support/paths.rb)

when /the profile page for "([^\"]*)"/
  user_path(User.find_by_username($1))

在这种情况下,您将访问场景中提供的用户名的“显示”操作(个人资料页面)。

I'm not entierly sure I understand the question - you want to be able to visit the 'show' page for a specific instance of a model?

Would somethign like this work? (taken from features/support/paths.rb)

when /the profile page for "([^\"]*)"/
  user_path(User.find_by_username($1))

In this case, you will visit the 'show' action (profile page) of the username supplied in the Scenario.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文