rubocop / rubocop-capybara

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

Cop idea: like a `Capybara/FindElementValueEq` cop #5

Open ydah opened 2 years ago

ydah commented 2 years ago

original issue: https://github.com/rubocop/rubocop-rspec/issues/1342#issue-1322935208

# bad
expect(find('input').value).to eq('foobar')
# good
expect(page).to have_field(with: 'foobar')
dmytro-savochkin commented 1 year ago

I would LOVE this! However I understand it might be pretty hard to implement, especially if not limiting to just .value -> have_field. It can be also .text -> have_content for example (and quite a few others?).