I want to check if a checkbox is checked using cucumber and capybara. I have checked the checkbox in my previous step and want to verify it by obtaining the value of the checkbox.
Use the checked? method
checked?
e.g.:
my_box = find('#some_checkbox') my_box.should be_checked # Before Rspec 2.11 # OR using new syntax expect(my_box).to be_checked # Rspec 2.11
2.1m questions
2.1m answers
60 comments
57.0k users