Created
October 16, 2013 06:03
-
-
Save shuhei/7003263 to your computer and use it in GitHub Desktop.
Assert number of elements with Capybara. Let's say we are testing a page whose JS adds elements step by step...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Bad | |
expect(all('.something').size).to eq(5) | |
# Good | |
expect(page).to have_css('.something', count: 5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment