Use the checked?
method
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
Related Contents:
- How do I get the HTML in an element using Capybara?
- Callback redirect not preserving session
- How to get parent node in Capybara?
- Unable to obtain stable firefox connection in 60 seconds (127.0.0.1:7055)
- How do I disable a feature in specflow (Gherkin) without deleting the feature?
- What are the differences between JBehave and Cucumber?
- Check select box has certain options with Capybara
- Cucumber / Capybara — how to get the host and port of the current execution
- Cucumber vs Capybara
- How to rerun the failed scenarios using Cucumber?
- Cucumber and Capybara, clicking a non-link or button element
- How can I see what capybara found in a failing cucumber step?
- Capybara does not pass header after form submit
- Can I escape the pipe in specflow (or gherkin)
- How to assert on number of html table rows in ruby using capybara + cucumber
- How to get current path with query string using Capybara
- RSpec vs Cucumber (RSpec stories) [closed]
- What’s the difference between RSpec and Cucumber? [closed]
- ERROR: Error installing capybara-webkit:
- How to find an element by matching exact text of the element in Capybara
- Reuse Cucumber steps
- Capybara Ambiguity Resolution
- Capybara: How do I fill in a input field by its ID
- How to do block comments in Gherkin?
- capybara assert attributes of an element
- How to assert number of elements using Capybara with proper error message?
- Cucumber alternative for .NET
- How to make Capybara check for visibility after some JS has run?
- With Capybara, how do I switch to the new window for links with “_blank” targets?
- How do I confirm a javascript popup with Capybara?
- Find or create record through factory_girl association
- How do I simulate hitting enter in an input field with Capybara and ChromeDriver?
- Capybara: Select an option by value not text
- setting request headers in selenium
- Get select value of dropdown for capybara testing
- How do poltergeist/PhantomJS and capybara-webkit differ?
- Good Cucumber examples in the wild? [closed]
- How to pass variables between cucumber-jvm steps
- Multiple Capybara wait times?
- Capybara with subdomains – default_host
- How to find last matching element in capybara?
- Ruby on Rails: Cucumber: how do I Rake a single feature?
- “undefined method `env’ for nil:NilClass” in ‘setup_controller_for_warden’ error when testing Devise using Rspec
- Why not use shared ActiveRecord connections for Rspec + Selenium?
- Rspec + Capybara : How to click on alert box
- How do I write a Capybara assertion that checks for the presence of a button and its enabled or disabled state?
- Cucumber’s ANSI colors messing up emacs compilation buffer
- Is it possible to interact with hidden elements with capybara?
- Capybara tests with :js=>true… Routing Error: No route matches [GET] “/assets”
- Outside-in BDD (with Specflow)