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: Detects chained Capybara::Node::Finders#find #72

Open ydah opened 11 months ago

ydah commented 11 months ago
# bad
page.find('#foo').find('.bar')

# good
page.find('#foo .bar')
boris-petrov commented 7 months ago

Great idea! Note, however, that cases like:

page.find('#foo', text: 'baz').find('.bar')

Cannot be changed to the latter.