Search code examples
tddcapybarabddbrowser-history

capybara / Observe html5/history route change


as it is somehow possible to wait for ajax calls (here and there), would there be a way to wait for or observe a route change in capybara (html5/browser history) ? Does a route change fire an event that we can listen to ?


Solution

  • Pushing to or popping from the history should change the current URL so you can use The have_current_path matcher

    expect(page).to have_current_path("/whatever")