使用水豚进行验收测试时奇怪的复选框行为
当我通过浏览器提交复选框全为空白的表单时,coach_ids=>[""]
和 recruit_board_ids"=>[""]
为空白,这很好但是
Parameters: {"utf8"=>"✓", "authenticity_token"=>"66vEbZPQ9aq/l1hYQbthRyjrYGtnrRQgLygFmgE8ZSA=", "recruit"=>{"coach_ids"=>[""], "recruit_board_ids"=>[""]}
当我使用 github 的边缘版本进行同样的验收测试时,这些复选框不是空白的。 params 哈希被精简以使其清晰。
params::{"utf8"=>"✓", "recruit"=>{"coach_ids"=>["[\"\"]"], "recruit_board_ids"=>["[\"\"]"]}
无法弄清楚出了什么问题?
When I submit a form with checkboxes all blank via browser, the coach_ids=>[""]
and recruit_board_ids"=>[""]
are blank and its fine.
Parameters: {"utf8"=>"✓", "authenticity_token"=>"66vEbZPQ9aq/l1hYQbthRyjrYGtnrRQgLygFmgE8ZSA=", "recruit"=>{"coach_ids"=>[""], "recruit_board_ids"=>[""]}
But when I do the same in acceptance test using capybara, edge version from github, those checkboxes aren't blank. It contains some weird escaped chars.
The params hash is trimmed down to make it clear.
params::{"utf8"=>"✓", "recruit"=>{"coach_ids"=>["[\"\"]"], "recruit_board_ids"=>["[\"\"]"]}
Couldn't figure out whats wrong??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来这是机架测试中的问题,尚未在官方版本中修复。请参阅https://github.com/brynary/rack-test/issues/12 和 https://github.com/jnicklas/capybara/issues/288/
It looks like it's a problem in rack-test that hasn't been fixed in an official build yet. See https://github.com/brynary/rack-test/issues/12 and https://github.com/jnicklas/capybara/issues/288/