使用水豚进行验收测试时奇怪的复选框行为

发布于 2024-11-02 03:56:34 字数 525 浏览 4 评论 0原文

当我通过浏览器提交复选框全为空白的表单时,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 技术交流群。

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

发布评论

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

评论(1

雨后咖啡店 2024-11-09 03:56:34

看起来这是机架测试中的问题,尚未在官方版本中修复。请参阅https://github.com/brynary/rack-test/issues/12https://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/

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