class RuboCop::Cop::RSpec::Capybara::CurrentPathExpectation


expect(page).to have_current_path(/widgets/)
expect(page).to have_current_path(“/callback”)
# good
expect(page.current_path).to match(/widgets/)
expect(current_path).to eq(‘/callback’)
# bad
@example
preceding actions (like ‘click_link`) have completed.
README.md#asynchronous-javascript-ajax-and-friends) which ensures that
functionality (github.com/teamcapybara/capybara/blob/master/
Capybara’s current path, since it uses Capybara’s waiting
instance_method) should be used on ‘page` to set expectations on
teamcapybara/capybara/master/Capybara/RSpecMatchers#have_current_path-
The `have_current_path` matcher (www.rubydoc.info/github/
Checks that no expectations are set on Capybara’s ‘current_path`.

def on_send(node)

def on_send(node)
  expectation_set_on_current_path(node) do
    add_offense(node, location: :selector)
  end
end