rubocop / rubocop-capybara

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

Capybara/CurrentPathExpectation is not valid when the page has query parameters #50

Closed jcoyne closed 11 months ago

jcoyne commented 1 year ago

The current_path is only the path (no parameters)

expect(current_path).to eq '/reserves/new'

The have_current_path does a comparison on the path + query parameters.

     Failure/Error: expect(page).to have_current_path '/reserves/new'
       expected "/reserves/new?comp_key=AA-272C%2C123%2C456" to equal "/reserves/new"