Webrat select_date 选择器失败
步骤文件中的代码:
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用“id_prefix”参数解决了
但这似乎是 Webrat 的错误。
Solved using "id_prefix" argument
Yet it seems to be Webrat's bug.