You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reliable way to check a path with Capybara (#2696)
I just saw a random failure at `./spec/features/products_index_spec.rb:22`.
It's a JS-enabled example with an expectation on `current_path`. This is one
of those cases where the previous action (in this case clicking on a link)
does not necessarily happen immediately, requiring a slight wait, and
therefore failing randomly.
I have changed all instances of this type of expectation to use
`have_current_path`, which is provided by Capybara and applies its
[waiting behaviour](https://github.com/teamcapybara/capybara?tab=readme-ov-file#asynchronous-javascript-ajax-and-friends) where appropriate.
Note that not all cases actually need it, as this is only a problem in
JS-enabled examples, but it's good to be consistent so I changed all.
0 commit comments