rubocop / rubocop-capybara

Code style checking for Capybara files.
https://docs.rubocop.org/rubocop-capybara
MIT License
40 stars 8 forks source link

Cop idea: Prefer to validate with a `have_*` matcher over retrieve the element with `find_*` and validate #35

Open ydah opened 1 year ago

ydah commented 1 year ago

# bad
expect(page.find_link('foo')[:class]).to eq 'some-cls'

# good
expect(page).to have_link('foo', class: 'some-cls')