开发者

Weird checkbox behaviour in acceptance testing using capybara

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 capy开发者_开发知识库bara, 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??


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/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜