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

def rewrite_expectation(corrector, node, to_symbol, matcher_node)

def rewrite_expectation(corrector, node, to_symbol, matcher_node)
  current_path_node = node.first_argument
  corrector.replace(current_path_node.loc.expression, 'page')
  corrector.replace(node.parent.loc.selector, 'to')
  matcher_method = if to_symbol == :to
                     'have_current_path'
                   else
                     'have_no_current_path'
                   end
  corrector.replace(matcher_node.loc.selector, matcher_method)
  add_ignore_query_options(corrector, node)
end