Webrat select_date 选择器失败

发布于 2024-09-02 01:59:00 字数 650 浏览 3 评论 0原文

步骤文件中的代码:

  select_date user.date_of_birth, :from => "Date of birth"

选择器失败

When I register with valid user credentials # features/step_definitions/authentication_steps.rb:2
  Could not find field: "user_date_of_birth_1i_1i" (Webrat::NotFoundError)
  ./features/step_definitions/authentication_steps.rb:9:in `/^I register with valid user credentials$/'
  features/authentication.feature:6:in `When I register with valid user credentials'

HTML 输出似乎很正常:

这是错误,还是我正在做的有事吗

Code in steps file:

  select_date user.date_of_birth, :from => "Date of birth"

Selector fail

When I register with valid user credentials # features/step_definitions/authentication_steps.rb:2
  Could not find field: "user_date_of_birth_1i_1i" (Webrat::NotFoundError)
  ./features/step_definitions/authentication_steps.rb:9:in `/^I register with valid user credentials$/'
  features/authentication.feature:6:in `When I register with valid user credentials'

HTML output seems to be normal:

<select name="user[date_of_birth(1i)]" id="user_date_of_birth_1i">

Is it bug, or I am doing something wrong

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

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

发布评论

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

评论(1

高冷爸爸 2024-09-09 01:59:00

使用“id_prefix”参数解决了

  select_date user.date_of_birth, :id_prefix => "user_date_of_birth"

但这似乎是 Webrat 的错误。

Solved using "id_prefix" argument

  select_date user.date_of_birth, :id_prefix => "user_date_of_birth"

Yet it seems to be Webrat's bug.

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