module Capybara::SessionMatchers

def _verify_current_path(path, options)

def _verify_current_path(path, options)
  query = Capybara::Queries::CurrentPathQuery.new(path, options)
  document.synchronize(query.wait) do
    yield(query)
  end
  return true
end

def assert_current_path(path, **options)

Returns:
  • (true) -

Raises:
  • (Capybara::ExpectationNotMet) - if the assertion hasn't succeeded during wait time

Options Hash: (**options)
  • :wait (Numeric) -- Maximum time that Capybara will wait for the current url/path to eq/match given string/regexp argument
  • :ignore_query (Boolean) -- Whether the query portion of the current url/path should be ignored
  • :url (Boolean) -- Whether the compare should be done against the full current url or just the path

Parameters:
  • regexp (Regexp) -- The regexp that the current 'path' should match to
  • string (String) -- The string that the current 'path' should equal

Overloads:
  • assert_current_path(regexp, options = {})
  • assert_current_path(string, options = {})
def assert_current_path(path, **options)
  _verify_current_path(path, options) { |query| raise Capybara::ExpectationNotMet, query.failure_message unless query.resolves_for?(self) }
end

def assert_no_current_path(path, **options)

Returns:
  • (true) -

Raises:
  • (Capybara::ExpectationNotMet) - if the assertion hasn't succeeded during wait time
def assert_no_current_path(path, **options)
  _verify_current_path(path, options) { |query| raise Capybara::ExpectationNotMet, query.negative_failure_message if query.resolves_for?(self) }
end

def has_current_path?(path, **options)

Returns:
  • (Boolean) -
def has_current_path?(path, **options)
  assert_current_path(path, options)
rescue Capybara::ExpectationNotMet
  return false
end

def has_no_current_path?(path, **options)

Returns:
  • (Boolean) -
def has_no_current_path?(path, **options)
  assert_no_current_path(path, options)
rescue Capybara::ExpectationNotMet
  return false
end