Using Capybara, I canβt choose me a checkbox in my form for my whole life.
In my request specification I tried:
check("First Name") page.check("First Name") page.check("pickem_option_ids_10") find(:css, "#pickem_option_ids_11[value='11']").set(true) find(:css, "#pickem_option_ids_11").set(true)
A snippet from my form:
<div class="control-group check_boxes optional"> <label class="check_boxes optional control-label">Options:</label> <div class="controls"> <label class="checkbox"> <input class="check_boxes optional" id="pickem_option_ids_10" name="pickem[option_ids][]" type="checkbox" value="10" />First Name </label> <label class="checkbox"> <input class="check_boxes optional" id="pickem_option_ids_11" name="pickem[option_ids][]" type="checkbox" value="11" />Middle Name </label> </div> </div>
I have some find () ideas from this SO thread .
I had some success in other specifications where I have one checkbox with an Active label and I just say check("Active") .
source share