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
1.4m articles
1.4m replys
5 comments
57.0k users